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
e56a6add
Unverified
Commit
e56a6add
authored
Jul 16, 2020
by
Jan Potoms
Committed by
GitHub
Jul 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for query param bug #15233 (#15238)
Fixes
https://github.com/vercel/next.js/issues/15233
parent
bd9fc12f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
0 deletions
+25
-0
index.js
test/integration/link-with-encoding/pages/index.js
+4
-0
query.js
test/integration/link-with-encoding/pages/query.js
+7
-0
index.test.js
test/integration/link-with-encoding/test/index.test.js
+14
-0
No files found.
test/integration/link-with-encoding/pages/index.js
View file @
e56a6add
...
@@ -30,6 +30,10 @@ const Home = () => (
...
@@ -30,6 +30,10 @@ const Home = () => (
>
>
<a id="
single
-
colon
">Single: :</a>
<a id="
single
-
colon
">Single: :</a>
</Link>
</Link>
<br />
<Link href="
/
query
?
id
=
http
:
//example.com/">
<
a
id
=
"url-param"
>
Url
query
param
<
/a
>
<
/Link
>
<
/div
>
<
/div
>
)
)
...
...
test/integration/link-with-encoding/pages/query.js
0 → 100644
View file @
e56a6add
export
function
getServerSideProps
({
query
})
{
return
{
props
:
query
}
}
export
default
function
Single
(
props
)
{
return
<
pre
id
=
"query-content"
>
{
JSON
.
stringify
(
props
)}
<
/pre
>
}
test/integration/link-with-encoding/test/index.test.js
View file @
e56a6add
...
@@ -295,5 +295,19 @@ describe('Link Component with Encoding', () => {
...
@@ -295,5 +295,19 @@ describe('Link Component with Encoding', () => {
await
browser
.
close
()
await
browser
.
close
()
}
}
})
})
it
(
'should have correct parsing of url query params'
,
async
()
=>
{
const
browser
=
await
webdriver
(
appPort
,
'/'
)
try
{
await
browser
.
waitForElementByCss
(
'#url-param'
).
click
()
const
content
=
await
browser
.
waitForElementByCss
(
'#query-content'
)
.
text
()
const
query
=
JSON
.
parse
(
content
)
expect
(
query
).
toHaveProperty
(
'id'
,
'http://example.com/'
)
}
finally
{
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