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
4a2e8e7f
Commit
4a2e8e7f
authored
Apr 03, 2026
by
Jimmy Lai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: add failing test for #79352 - inconsistent 404 with parallel routes
parent
daca04d0
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
105 additions
and
0 deletions
+105
-0
page.tsx
...es-404-consistency/app/@breadcrumb/[...catchAll]/page.tsx
+8
-0
default.tsx
...rallel-routes-404-consistency/app/@breadcrumb/default.tsx
+3
-0
page.tsx
...el-routes-404-consistency/app/@breadcrumb/page-a/page.tsx
+3
-0
layout.tsx
...2e/app-dir/parallel-routes-404-consistency/app/layout.tsx
+16
-0
not-found.tsx
...app-dir/parallel-routes-404-consistency/app/not-found.tsx
+3
-0
page.tsx
...p-dir/parallel-routes-404-consistency/app/page-a/page.tsx
+12
-0
page.tsx
...p-dir/parallel-routes-404-consistency/app/page-b/page.tsx
+3
-0
page.tsx
.../e2e/app-dir/parallel-routes-404-consistency/app/page.tsx
+3
-0
next.config.js
...2e/app-dir/parallel-routes-404-consistency/next.config.js
+6
-0
parallel-routes-404-consistency.test.ts
...s-404-consistency/parallel-routes-404-consistency.test.ts
+48
-0
No files found.
test/e2e/app-dir/parallel-routes-404-consistency/app/@breadcrumb/[...catchAll]/page.tsx
0 → 100644
View file @
4a2e8e7f
export
default
async
function
BreadcrumbCatchAll
({
params
,
}:
{
params
:
Promise
<
{
catchAll
:
string
[]
}
>
})
{
const
{
catchAll
}
=
await
params
return
<
p
>
Breadcrumb:
{
catchAll
.
join
(
'/'
)
}
</
p
>
}
test/e2e/app-dir/parallel-routes-404-consistency/app/@breadcrumb/default.tsx
0 → 100644
View file @
4a2e8e7f
export
default
function
BreadcrumbDefault
()
{
return
<
p
>
Breadcrumb: Home
</
p
>
}
test/e2e/app-dir/parallel-routes-404-consistency/app/@breadcrumb/page-a/page.tsx
0 → 100644
View file @
4a2e8e7f
export
default
function
BreadcrumbPageA
()
{
return
<
p
>
Breadcrumb: Page A
</
p
>
}
test/e2e/app-dir/parallel-routes-404-consistency/app/layout.tsx
0 → 100644
View file @
4a2e8e7f
export
default
function
RootLayout
({
children
,
breadcrumb
,
}:
{
children
:
React
.
ReactNode
breadcrumb
:
React
.
ReactNode
})
{
return
(
<
html
>
<
body
>
<
div
id=
"breadcrumb"
>
{
breadcrumb
}
</
div
>
<
div
id=
"children"
>
{
children
}
</
div
>
</
body
>
</
html
>
)
}
test/e2e/app-dir/parallel-routes-404-consistency/app/not-found.tsx
0 → 100644
View file @
4a2e8e7f
export
default
function
NotFound
()
{
return
<
p
>
404 Not Found
</
p
>
}
test/e2e/app-dir/parallel-routes-404-consistency/app/page-a/page.tsx
0 → 100644
View file @
4a2e8e7f
import
Link
from
'next/link'
export
default
function
PageA
()
{
return
(
<
div
>
<
p
>
Page A Content
</
p
>
<
Link
href=
"/does-not-exist"
id=
"link-to-nonexistent"
>
Go to nonexistent page
</
Link
>
</
div
>
)
}
test/e2e/app-dir/parallel-routes-404-consistency/app/page-b/page.tsx
0 → 100644
View file @
4a2e8e7f
export
default
function
PageB
()
{
return
<
p
>
Page B Content
</
p
>
}
test/e2e/app-dir/parallel-routes-404-consistency/app/page.tsx
0 → 100644
View file @
4a2e8e7f
export
default
function
HomePage
()
{
return
<
p
>
Home Page
</
p
>
}
test/e2e/app-dir/parallel-routes-404-consistency/next.config.js
0 → 100644
View file @
4a2e8e7f
/**
* @type {import('next').NextConfig}
*/
const
nextConfig
=
{}
module
.
exports
=
nextConfig
test/e2e/app-dir/parallel-routes-404-consistency/parallel-routes-404-consistency.test.ts
0 → 100644
View file @
4a2e8e7f
import
{
nextTestSetup
}
from
'e2e-utils'
import
{
retry
}
from
'next-test-utils'
describe
(
'parallel-routes-404-consistency'
,
()
=>
{
const
{
next
}
=
nextTestSetup
({
files
:
__dirname
,
})
it
(
'should show 404 on direct navigation to nonexistent route'
,
async
()
=>
{
const
browser
=
await
next
.
browser
(
'/does-not-exist'
)
await
retry
(
async
()
=>
{
const
text
=
await
browser
.
elementByCss
(
'body'
).
text
()
expect
(
text
).
toContain
(
'404 Not Found'
)
})
})
it
(
'should show 404 on client-side navigation to nonexistent route'
,
async
()
=>
{
const
browser
=
await
next
.
browser
(
'/page-a'
)
// Verify we are on page-a
await
retry
(
async
()
=>
{
const
text
=
await
browser
.
elementById
(
'children'
).
text
()
expect
(
text
).
toContain
(
'Page A Content'
)
})
// Verify breadcrumb shows Page A
await
retry
(
async
()
=>
{
const
text
=
await
browser
.
elementById
(
'breadcrumb'
).
text
()
expect
(
text
).
toContain
(
'Breadcrumb: Page A'
)
})
// Click the link to a nonexistent page
await
browser
.
elementByCss
(
'#link-to-nonexistent'
).
click
()
// After client-side navigation to a nonexistent route, we should see
// the 404 page, not stale content from Page A.
// BUG #79352: The catch-all @breadcrumb slot matches /does-not-exist,
// so the response is 200 and the children slot falls back to
// __DEFAULT__, causing reuseActiveSegmentInDefaultSlot() to reuse
// the stale Page A content instead of showing a 404.
await
retry
(
async
()
=>
{
const
bodyText
=
await
browser
.
elementByCss
(
'body'
).
text
()
expect
(
bodyText
).
toContain
(
'404 Not Found'
)
expect
(
bodyText
).
not
.
toContain
(
'Page A Content'
)
})
})
})
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