mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Add some test cases for nested pages with next export.
This commit is contained in:
parent
4be25270c6
commit
d7048e13fa
|
@ -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>{`
|
||||
|
|
12
test/integration/static/pages/level1/about.js
Normal file
12
test/integration/static/pages/level1/about.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
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>
|
||||
)
|
12
test/integration/static/pages/level1/index.js
Normal file
12
test/integration/static/pages/level1/index.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
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()
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue