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
63e373bf
Commit
63e373bf
authored
Jul 31, 2025
by
Janka Uryga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: partially disable root params tests when deployed
parent
f05f9eff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
50 deletions
+56
-50
prefetch-runtime.test.ts
...r/segment-cache/prefetch-runtime/prefetch-runtime.test.ts
+56
-50
No files found.
test/e2e/app-dir/segment-cache/prefetch-runtime/prefetch-runtime.test.ts
View file @
63e373bf
...
@@ -152,23 +152,26 @@ describe('<Link prefetch={true}> (runtime prefetch)', () => {
...
@@ -152,23 +152,26 @@ describe('<Link prefetch={true}> (runtime prefetch)', () => {
},
},
])
])
// Reveal the link to trigger a runtime prefetch for a different value of the root param
// TODO(runtime-ppr) - visiting root params that weren't in generateStaticParams errors when deployed
await
act
(
async
()
=>
{
if
(
!
isNextDeploy
)
{
const
linkToggle
=
await
browser
.
elementByCss
(
// Reveal the link to trigger a runtime prefetch for a different value of the root param
`input[data-link-accordion="/with-root-param/de/
${
prefix
}
/root-params"]`
await
act
(
async
()
=>
{
)
const
linkToggle
=
await
browser
.
elementByCss
(
await
linkToggle
.
click
()
`input[data-link-accordion="/with-root-param/de/
${
prefix
}
/root-params"]`
},
[
)
// Should allow reading root params
await
linkToggle
.
click
()
{
},
[
includes
:
'Lang: de'
,
// Should allow reading root params
},
{
// Should not prefetch the dynamic content
includes
:
'Lang: de'
,
{
},
includes
:
'Dynamic content'
,
// Should not prefetch the dynamic content
block
:
'reject'
,
{
},
includes
:
'Dynamic content'
,
])
block
:
'reject'
,
},
])
}
// Navigate to the first page
// Navigate to the first page
await
act
(
async
()
=>
{
await
act
(
async
()
=>
{
...
@@ -199,44 +202,47 @@ describe('<Link prefetch={true}> (runtime prefetch)', () => {
...
@@ -199,44 +202,47 @@ describe('<Link prefetch={true}> (runtime prefetch)', () => {
'Dynamic content'
'Dynamic content'
)
)
await
browser
.
back
()
// TODO(runtime-ppr) - visiting root params that weren't in generateStaticParams errors when deployed
if
(
!
isNextDeploy
)
{
await
browser
.
back
()
// Reveal the link to the second page again. It should not be prefetched again
// Reveal the link to the second page again. It should not be prefetched again
await
act
(
async
()
=>
{
await
act
(
async
()
=>
{
const
linkToggle
=
await
browser
.
elementByCss
(
const
linkToggle
=
await
browser
.
elementByCss
(
`input[data-link-accordion="/with-root-param/de/
${
prefix
}
/root-params"]`
`input[data-link-accordion="/with-root-param/de/
${
prefix
}
/root-params"]`
)
)
await
linkToggle
.
click
()
await
linkToggle
.
click
()
},
'no-requests'
)
},
'no-requests'
)
// Navigate to the other page
// Navigate to the other page
await
act
(
async
()
=>
{
await
act
(
async
()
=>
{
await
act
(
await
act
(
async
()
=>
{
async
()
=>
{
await
browser
await
browser
.
elementByCss
(
.
elementByCss
(
`a[href="/with-root-param/de/
${
prefix
}
/root-params"]`
`a[href="/with-root-param/de/
${
prefix
}
/root-params"]`
)
)
.
click
()
.
click
()
},
},
{
{
// Temporarily block the navigation request.
// Temporarily block the navigation request.
// The runtime-prefetched parts of the tree should be visible before it finishes.
// The runtime-prefetched parts of the tree should be visible before it finishes.
includes
:
'Dynamic content'
,
includes
:
'Dynamic content'
,
block
:
true
,
block
:
true
,
}
}
)
)
expect
(
await
browser
.
elementById
(
'root-param-value'
).
text
()).
toEqual
(
'Lang: de'
)
})
// After navigating, we should see both the parts that we prefetched and dynamic content.
expect
(
await
browser
.
elementById
(
'root-param-value'
).
text
()).
toEqual
(
expect
(
await
browser
.
elementById
(
'root-param-value'
).
text
()).
toEqual
(
'Lang: de'
'Lang: de'
)
)
})
expect
(
await
browser
.
elementById
(
'dynamic-content'
).
text
()).
toEqual
(
// After navigating, we should see both the parts that we prefetched and dynamic content.
'Dynamic content'
expect
(
await
browser
.
elementById
(
'root-param-value'
).
text
()).
toEqual
(
)
'Lang: de'
}
)
expect
(
await
browser
.
elementById
(
'dynamic-content'
).
text
()).
toEqual
(
'Dynamic content'
)
})
})
it
(
'includes search params, but not dynamic content'
,
async
()
=>
{
it
(
'includes search params, but not dynamic content'
,
async
()
=>
{
...
...
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