Commit d7048e13 authored by Arunoda Susiripala's avatar Arunoda Susiripala

Add some test cases for nested pages with next export.

parent 4be25270
......@@ -39,6 +39,12 @@ export default () => (
>
<a id='dynamic-2'>Dynamic 2</a>
</Link>
<Link href='/level1'>
<a id='level1-home-page'>Level1 home page</a>
</Link>
<Link href='/level1/about'>
<a id='level1-about-page'>Level1 about page</a>
</Link>
</div>
<p>This is the home page</p>
<style jsx>{`
......
import Link from 'next/link'
export default () => (
<div id='level1-about-page'>
<div>
<Link href='/'>
<a>Go Back</a>
</Link>
</div>
<p>This is the Level1 about page</p>
</div>
)
import Link from 'next/link'
export default () => (
<div id='level1-home-page'>
<div>
<Link href='/'>
<a>Go Back</a>
</Link>
</div>
<p>This is the Level1 home page</p>
</div>
)
......@@ -92,5 +92,29 @@ export default function (context) {
browser.close()
})
describe('pages in the nested level: level1', () => {
it('should render the home page', async () => {
const browser = await webdriver(context.port, '/')
const text = await browser
.elementByCss('#level1-home-page').click()
.waitForElementByCss('#level1-home-page')
.elementByCss('#level1-home-page p').text()
expect(text).toBe('This is the Level1 home page')
browser.close()
})
it('should render the about page', async () => {
const browser = await webdriver(context.port, '/')
const text = await browser
.elementByCss('#level1-about-page').click()
.waitForElementByCss('#level1-about-page')
.elementByCss('#level1-about-page p').text()
expect(text).toBe('This is the Level1 about page')
browser.close()
})
})
})
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment