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
a0453a7b
Commit
a0453a7b
authored
Feb 12, 2017
by
Tim Neutkens
Committed by
Guillermo Rauch
Feb 12, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for behaviour mentioned in #1079 (#1084)
parent
66d97744
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
0 deletions
+46
-0
querystring.js
test/integration/basic/pages/nav/querystring.js
+22
-0
client-navigation.js
test/integration/basic/test/client-navigation.js
+24
-0
No files found.
test/integration/basic/pages/nav/querystring.js
0 → 100644
View file @
a0453a7b
import
React
from
'react'
import
Link
from
'next/link'
export
default
class
AsyncProps
extends
React
.
Component
{
static
async
getInitialProps
({
query
:
{
id
=
0
}
})
{
return
{
id
}
}
render
()
{
return
(
<
div
>
<
Link
href
=
{
`/nav/querystring?id=
${
parseInt
(
this
.
props
.
id
)
+
1
}
`
}
>
<
a
id
=
'next-id-link'
>
Click
here
<
/a
>
<
/Link
>
<
Link
href
=
'/nav/querystring'
>
<
a
id
=
'main-page'
>
Click
here
<
/a
>
<
/Link
>
<
p
className
=
{
`nav-id-
${
this
.
props
.
id
}
`
}
>
{
this
.
props
.
id
}
<
/p
>
<
/div
>
)
}
}
test/integration/basic/test/client-navigation.js
View file @
a0453a7b
...
...
@@ -59,5 +59,29 @@ export default (context) => {
await
browser
.
close
()
})
})
describe
(
'with the same page but different querystring'
,
()
=>
{
it
(
'should navigate the page'
,
async
()
=>
{
const
browser
=
await
webdriver
(
context
.
appPort
,
'/nav/querystring?id=1'
)
const
text
=
await
browser
.
elementByCss
(
'#next-id-link'
).
click
()
.
waitForElementByCss
(
'.nav-id-2'
)
.
elementByCss
(
'p'
).
text
()
expect
(
text
).
toBe
(
'2'
)
await
browser
.
close
()
})
it
(
'should remove querystring'
,
async
()
=>
{
const
browser
=
await
webdriver
(
context
.
appPort
,
'/nav/querystring?id=1'
)
const
text
=
await
browser
.
elementByCss
(
'#main-page'
).
click
()
.
waitForElementByCss
(
'.nav-id-0'
)
.
elementByCss
(
'p'
).
text
()
expect
(
text
).
toBe
(
'0'
)
await
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