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
1a9b49bf
Unverified
Commit
1a9b49bf
authored
Mar 06, 2020
by
Joe Haddad
Committed by
GitHub
Mar 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Prerender Test Cases (#10861)
* Fix Prerender Test Cases * fix test
parent
49369d76
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
index.js
test/integration/prerender/pages/index.js
+1
-1
index.test.js
test/integration/prerender/test/index.test.js
+4
-4
No files found.
test/integration/prerender/pages/index.js
View file @
1a9b49bf
...
...
@@ -33,7 +33,7 @@ const Page = ({ world, time }) => {
<
Link
href
=
"/blog/[post]"
as
=
"/blog/post-100"
>
<
a
id
=
"broken-post"
>
to
broken
<
/a
>
<
/Link
>
<
Link
href
=
"/blog/[post]"
as
=
"/blog/post-999"
>
<
Link
href
=
"/blog/[post]"
as
=
"/blog/post-999"
prefetch
=
{
false
}
>
<
a
id
=
"broken-at-first-post"
>
to
broken
at
first
<
/a
>
<
/Link
>
<
br
/>
...
...
test/integration/prerender/test/index.test.js
View file @
1a9b49bf
...
...
@@ -377,10 +377,10 @@ const runTests = (dev = false, looseMode = false) => {
it
(
'should reload page on failed data request'
,
async
()
=>
{
const
browser
=
await
webdriver
(
appPort
,
'/'
)
await
browser
.
eval
(
'window.beforeClick =
true
'
)
await
browser
.
eval
(
'window.beforeClick =
"abc"
'
)
await
browser
.
elementByCss
(
'#broken-post'
).
click
()
await
waitFor
(
1000
)
expect
(
await
browser
.
eval
(
'window.beforeClick'
)).
not
.
toBe
(
'
true
'
)
expect
(
await
browser
.
eval
(
'window.beforeClick'
)).
not
.
toBe
(
'
abc
'
)
})
// TODO: dev currently renders this page as blocking, meaning it shows the
...
...
@@ -388,10 +388,10 @@ const runTests = (dev = false, looseMode = false) => {
if
(
!
dev
)
{
it
(
'should reload page on failed data request, and retry'
,
async
()
=>
{
const
browser
=
await
webdriver
(
appPort
,
'/'
)
await
browser
.
eval
(
'window.beforeClick =
true
'
)
await
browser
.
eval
(
'window.beforeClick =
"abc"
'
)
await
browser
.
elementByCss
(
'#broken-at-first-post'
).
click
()
await
waitFor
(
3000
)
expect
(
await
browser
.
eval
(
'window.beforeClick'
)).
not
.
toBe
(
'
true
'
)
expect
(
await
browser
.
eval
(
'window.beforeClick'
)).
not
.
toBe
(
'
abc
'
)
const
text
=
await
browser
.
elementByCss
(
'#params'
).
text
()
expect
(
text
).
toMatch
(
/post.*
?
post-999/
)
...
...
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