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
90841a5f
Commit
90841a5f
authored
Apr 03, 2026
by
Jimmy Lai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: add failing test for #67034 - interception with identical paths in different groups
parent
daca04d0
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
125 additions
and
0 deletions
+125
-0
page.tsx
...s-duplicate-groups/app/(group1)/@modal/(.)shared/page.tsx
+3
-0
default.tsx
...g-routes-duplicate-groups/app/(group1)/@modal/default.tsx
+3
-0
layout.tsx
...ercepting-routes-duplicate-groups/app/(group1)/layout.tsx
+15
-0
page.tsx
...ntercepting-routes-duplicate-groups/app/(group1)/page.tsx
+12
-0
page.tsx
...s-duplicate-groups/app/(group2)/@modal/(.)shared/page.tsx
+3
-0
default.tsx
...g-routes-duplicate-groups/app/(group2)/@modal/default.tsx
+3
-0
page.tsx
...ting-routes-duplicate-groups/app/(group2)/group2/page.tsx
+12
-0
layout.tsx
...ercepting-routes-duplicate-groups/app/(group2)/layout.tsx
+15
-0
layout.tsx
...p-dir/intercepting-routes-duplicate-groups/app/layout.tsx
+8
-0
page.tsx
.../intercepting-routes-duplicate-groups/app/shared/page.tsx
+7
-0
intercepting-routes-duplicate-groups.test.ts
...icate-groups/intercepting-routes-duplicate-groups.test.ts
+38
-0
next.config.js
...p-dir/intercepting-routes-duplicate-groups/next.config.js
+6
-0
No files found.
test/e2e/app-dir/intercepting-routes-duplicate-groups/app/(group1)/@modal/(.)shared/page.tsx
0 → 100644
View file @
90841a5f
export
default
function
InterceptedFromGroup1
()
{
return
<
div
id=
"intercepted-modal"
>
Intercepted from Group 1
</
div
>
}
test/e2e/app-dir/intercepting-routes-duplicate-groups/app/(group1)/@modal/default.tsx
0 → 100644
View file @
90841a5f
export
default
function
Default
()
{
return
null
}
test/e2e/app-dir/intercepting-routes-duplicate-groups/app/(group1)/layout.tsx
0 → 100644
View file @
90841a5f
import
{
ReactNode
}
from
'react'
export
default
function
Group1Layout
({
children
,
modal
,
}:
{
children
:
ReactNode
modal
:
ReactNode
})
{
return
(
<>
<
div
id=
"group1-children"
>
{
children
}
</
div
>
<
div
id=
"group1-modal"
>
{
modal
}
</
div
>
</>
)
}
test/e2e/app-dir/intercepting-routes-duplicate-groups/app/(group1)/page.tsx
0 → 100644
View file @
90841a5f
import
Link
from
'next/link'
export
default
function
Group1Home
()
{
return
(
<
div
>
<
h1
>
Group 1 Home
</
h1
>
<
Link
href=
"/shared"
id=
"group1-link"
>
Go to shared
</
Link
>
</
div
>
)
}
test/e2e/app-dir/intercepting-routes-duplicate-groups/app/(group2)/@modal/(.)shared/page.tsx
0 → 100644
View file @
90841a5f
export
default
function
InterceptedFromGroup2
()
{
return
<
div
id=
"intercepted-modal"
>
Intercepted from Group 2
</
div
>
}
test/e2e/app-dir/intercepting-routes-duplicate-groups/app/(group2)/@modal/default.tsx
0 → 100644
View file @
90841a5f
export
default
function
Default
()
{
return
null
}
test/e2e/app-dir/intercepting-routes-duplicate-groups/app/(group2)/group2/page.tsx
0 → 100644
View file @
90841a5f
import
Link
from
'next/link'
export
default
function
Group2Page
()
{
return
(
<
div
>
<
h1
>
Group 2 Page
</
h1
>
<
Link
href=
"/shared"
id=
"group2-link"
>
Go to shared
</
Link
>
</
div
>
)
}
test/e2e/app-dir/intercepting-routes-duplicate-groups/app/(group2)/layout.tsx
0 → 100644
View file @
90841a5f
import
{
ReactNode
}
from
'react'
export
default
function
Group2Layout
({
children
,
modal
,
}:
{
children
:
ReactNode
modal
:
ReactNode
})
{
return
(
<>
<
div
id=
"group2-children"
>
{
children
}
</
div
>
<
div
id=
"group2-modal"
>
{
modal
}
</
div
>
</>
)
}
test/e2e/app-dir/intercepting-routes-duplicate-groups/app/layout.tsx
0 → 100644
View file @
90841a5f
import
{
ReactNode
}
from
'react'
export
default
function
Root
({
children
}:
{
children
:
ReactNode
})
{
return
(
<
html
>
<
body
>
{
children
}
</
body
>
</
html
>
)
}
test/e2e/app-dir/intercepting-routes-duplicate-groups/app/shared/page.tsx
0 → 100644
View file @
90841a5f
export
default
function
SharedPage
()
{
return
(
<
div
>
<
h1
id=
"full-page"
>
Full Shared Page
</
h1
>
</
div
>
)
}
test/e2e/app-dir/intercepting-routes-duplicate-groups/intercepting-routes-duplicate-groups.test.ts
0 → 100644
View file @
90841a5f
import
{
nextTestSetup
}
from
'e2e-utils'
import
{
retry
}
from
'next-test-utils'
describe
(
'intercepting-routes-duplicate-groups'
,
()
=>
{
const
{
next
}
=
nextTestSetup
({
files
:
__dirname
,
})
it
(
'should intercept from group1'
,
async
()
=>
{
const
browser
=
await
next
.
browser
(
'/'
)
await
browser
.
elementByCss
(
'#group1-link'
).
click
()
await
retry
(
async
()
=>
{
expect
(
await
browser
.
elementById
(
'intercepted-modal'
).
text
()).
toBe
(
'Intercepted from Group 1'
)
})
})
it
(
'should intercept from group2'
,
async
()
=>
{
const
browser
=
await
next
.
browser
(
'/group2'
)
await
browser
.
elementByCss
(
'#group2-link'
).
click
()
await
retry
(
async
()
=>
{
// This assertion should verify the interception works from group2.
// Due to the bug (#67034), the interception from group2 does not work:
// generate-interception-routes-rewrites.ts strips route group context,
// producing identical rewrite rules for both groups.
// Only the first group's rewrite matches, so group2 falls through
// to the full /shared page instead of showing the intercepted modal.
expect
(
await
browser
.
elementById
(
'intercepted-modal'
).
text
()).
toBe
(
'Intercepted from Group 2'
)
})
})
})
test/e2e/app-dir/intercepting-routes-duplicate-groups/next.config.js
0 → 100644
View file @
90841a5f
/**
* @type {import('next').NextConfig}
*/
const
nextConfig
=
{}
module
.
exports
=
nextConfig
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