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
721eb615
Unverified
Commit
721eb615
authored
Oct 27, 2025
by
Sebastian "Sebbie" Silbermann
Committed by
GitHub
Oct 27, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[test] Speed up prefetching suite (#85417)
parent
6ea6270e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
30 deletions
+15
-30
page.js
test/e2e/app-dir/app-prefetch/app/dashboard/[id]/page.js
+1
-2
layout.js
test/e2e/app-dir/app-prefetch/app/layout.js
+0
-1
layout.tsx
...ir/app-prefetch/app/prefetch-auto-route-groups/layout.tsx
+8
-14
layout.js
...e/app-dir/app-prefetch/app/prefetch-auto/[slug]/layout.js
+1
-6
page.js
...e2e/app-dir/app-prefetch/app/prefetch-auto/[slug]/page.js
+1
-1
prefetching.test.ts
test/e2e/app-dir/app-prefetch/prefetching.test.ts
+4
-6
No files found.
test/e2e/app-dir/app-prefetch/app/dashboard/[id]/page.js
View file @
721eb615
...
...
@@ -14,8 +14,7 @@ export function generateStaticParams() {
export
default
function
IdPage
(
props
)
{
const
params
=
use
(
props
.
params
)
const
data
=
use
(
getData
())
console
.
log
(
data
)
use
(
getData
())
if
(
params
.
id
===
'123'
)
{
return
(
...
...
test/e2e/app-dir/app-prefetch/app/layout.js
View file @
721eb615
...
...
@@ -2,7 +2,6 @@ export default function Root({ children }) {
return
(
<
html
>
<
head
>
<
script
src
=
"https://cdn.tailwindcss.com?plugins=typography"
><
/script
>
<
title
>
Hello
World
<
/title
>
<
script
dangerouslySetInnerHTML
=
{{
...
...
test/e2e/app-dir/app-prefetch/app/prefetch-auto-route-groups/layout.tsx
View file @
721eb615
...
...
@@ -5,22 +5,16 @@ import Link from 'next/link'
export
default
function
Layout
({
children
}:
{
children
:
React
.
ReactNode
})
{
return
(
<>
<
nav
className=
"bg-gray-800"
>
<
ul
className=
"flex"
>
<
li
className=
"mr-6"
>
<
Link
href=
"/prefetch-auto-route-groups"
>
<
p
className=
"text-white hover:text-gray-300"
>
Dashboard
</
p
>
</
Link
>
<
nav
style=
{
{
border
:
'1px solid #1f2937'
}
}
>
<
ul
style=
{
{
display
:
'flex'
}
}
>
<
li
style=
{
{
marginRight
:
'1.5rem'
}
}
>
<
Link
href=
"/prefetch-auto-route-groups"
>
Dashboard
</
Link
>
</
li
>
<
li
className=
"mr-6"
>
<
Link
href=
"/prefetch-auto-route-groups/sub/foo"
>
<
p
className=
"text-white hover:text-gray-300"
>
Foo
</
p
>
</
Link
>
<
li
style=
{
{
marginRight
:
'1.5rem'
}
}
>
<
Link
href=
"/prefetch-auto-route-groups/sub/foo"
>
Foo
</
Link
>
</
li
>
<
li
className=
"mr-6"
>
<
Link
href=
"/prefetch-auto-route-groups/sub/bar"
>
<
p
className=
"text-white hover:text-gray-300"
>
Bar
</
p
>
</
Link
>
<
li
style=
{
{
marginRight
:
'1.5rem'
}
}
>
<
Link
href=
"/prefetch-auto-route-groups/sub/bar"
>
Bar
</
Link
>
</
li
>
</
ul
>
</
nav
>
...
...
test/e2e/app-dir/app-prefetch/app/prefetch-auto/[slug]/layout.js
View file @
721eb615
import
Link
from
'next/link'
export
const
dynamic
=
'force-dynamic'
function
getData
()
{
const
res
=
new
Promise
((
resolve
)
=>
{
setTimeout
(()
=>
{
resolve
({
message
:
'Layout Data!'
})
},
2
000
)
},
1
000
)
})
return
res
}
...
...
@@ -17,9 +15,6 @@ export default async function Layout({ children }) {
return
(
<
div
>
<
h1
>
Layout
<
/h1
>
<
Link
prefetch
=
{
undefined
}
href
=
"/prefetch-auto/justputit"
>
Prefetch
Link
<
/Link
>
{
children
}
<
h3
>
{
JSON
.
stringify
(
result
)}
<
/h3
>
<
/div
>
...
...
test/e2e/app-dir/app-prefetch/app/prefetch-auto/[slug]/page.js
View file @
721eb615
...
...
@@ -4,7 +4,7 @@ function getData() {
const
res
=
new
Promise
((
resolve
)
=>
{
setTimeout
(()
=>
{
resolve
({
message
:
'Page Data!'
})
},
2
000
)
},
1
000
)
})
return
res
}
...
...
test/e2e/app-dir/app-prefetch/prefetching.test.ts
View file @
721eb615
...
...
@@ -314,22 +314,20 @@ describe('app dir - prefetching', () => {
async
()
=>
{
const
reveal
=
await
browser
.
elementByCss
(
'#accordion-to-dynamic-page'
)
await
reveal
.
click
()
await
browser
.
waitForElementByCss
(
'#to-dynamic-page'
)
return
await
browser
.
elementByCss
(
'#to-dynamic-page'
)
return
browser
.
elementByCss
(
'#to-dynamic-page'
)
},
{
includes
:
'Loading Prefetch Auto'
}
)
// Click the link to navigate - should trigger dynamic data fetch
await
act
(
const
loadingText
=
await
act
(
async
()
=>
{
await
link
.
click
()
await
browser
.
waitForElementByCss
(
'#loading-text'
)
const
loadingText
=
await
browser
.
elementByCss
(
'#loading-text'
).
text
()
expect
(
loadingText
).
toBe
(
'Loading Prefetch Auto'
)
return
browser
.
elementByCss
(
'#loading-text'
).
text
()
},
{
includes
:
'prefetch-auto-page-data'
}
)
expect
(
loadingText
).
toBe
(
'Loading Prefetch Auto'
)
// Wait for final data to appear
await
browser
.
waitForElementByCss
(
'#prefetch-auto-page-data'
)
...
...
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