Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
d7048e13
Commit
d7048e13
authored
May 11, 2017
by
Arunoda Susiripala
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some test cases for nested pages with next export.
parent
4be25270
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
0 deletions
+54
-0
index.js
test/integration/static/pages/index.js
+6
-0
about.js
test/integration/static/pages/level1/about.js
+12
-0
index.js
test/integration/static/pages/level1/index.js
+12
-0
browser.js
test/integration/static/test/browser.js
+24
-0
No files found.
test/integration/static/pages/index.js
View file @
d7048e13
...
@@ -39,6 +39,12 @@ export default () => (
...
@@ -39,6 +39,12 @@ export default () => (
>
>
<
a
id
=
'dynamic-2'
>
Dynamic
2
<
/a
>
<
a
id
=
'dynamic-2'
>
Dynamic
2
<
/a
>
<
/Link
>
<
/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
>
<
/div
>
<
p
>
This
is
the
home
page
<
/p
>
<
p
>
This
is
the
home
page
<
/p
>
<
style
jsx
>
{
`
<
style
jsx
>
{
`
...
...
test/integration/static/pages/level1/about.js
0 → 100644
View file @
d7048e13
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
>
)
test/integration/static/pages/level1/index.js
0 → 100644
View file @
d7048e13
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
>
)
test/integration/static/test/browser.js
View file @
d7048e13
...
@@ -92,5 +92,29 @@ export default function (context) {
...
@@ -92,5 +92,29 @@ export default function (context) {
browser
.
close
()
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
()
})
})
})
})
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment