-
-
- + client
- - server"
+
+
+
+ + client
+ - server"
`)
} else {
expect(fullPseudoHtml).toMatchInlineSnapshot(`
"...
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
- + client
- - server"
+
+
+
+ + client
+ - server"
`)
}
diff --git a/test/e2e/app-dir/parallel-routes-css/app/@foo/[...catchAll]/page.tsx b/test/e2e/app-dir/parallel-routes-css/app/@foo/[...catchAll]/page.tsx
new file mode 100644
index 0000000000000..6c26d0f730cfb
--- /dev/null
+++ b/test/e2e/app-dir/parallel-routes-css/app/@foo/[...catchAll]/page.tsx
@@ -0,0 +1,9 @@
+import styles from './style.module.css'
+
+export default function Page() {
+ return (
+
+ Slot
+
+ )
+}
diff --git a/test/e2e/app-dir/parallel-routes-css/app/@foo/[...catchAll]/style.module.css b/test/e2e/app-dir/parallel-routes-css/app/@foo/[...catchAll]/style.module.css
new file mode 100644
index 0000000000000..dc9f187170250
--- /dev/null
+++ b/test/e2e/app-dir/parallel-routes-css/app/@foo/[...catchAll]/style.module.css
@@ -0,0 +1,3 @@
+.bgRed {
+ background-color: red;
+}
diff --git a/test/e2e/app-dir/parallel-routes-css/app/@foo/default.tsx b/test/e2e/app-dir/parallel-routes-css/app/@foo/default.tsx
new file mode 100644
index 0000000000000..c17431379f962
--- /dev/null
+++ b/test/e2e/app-dir/parallel-routes-css/app/@foo/default.tsx
@@ -0,0 +1,3 @@
+export default function Page() {
+ return null
+}
diff --git a/test/e2e/app-dir/parallel-routes-css/app/layout.tsx b/test/e2e/app-dir/parallel-routes-css/app/layout.tsx
new file mode 100644
index 0000000000000..e76395794b57e
--- /dev/null
+++ b/test/e2e/app-dir/parallel-routes-css/app/layout.tsx
@@ -0,0 +1,20 @@
+import { ReactNode } from 'react'
+
+const RootLayout = ({
+ children,
+ foo,
+}: {
+ children: ReactNode
+ foo: ReactNode
+}) => {
+ return (
+
+
+ {children}
+ {foo}
+
+
+ )
+}
+
+export default RootLayout
diff --git a/test/e2e/app-dir/parallel-routes-css/app/nested/page.tsx b/test/e2e/app-dir/parallel-routes-css/app/nested/page.tsx
new file mode 100644
index 0000000000000..05a571d2744d5
--- /dev/null
+++ b/test/e2e/app-dir/parallel-routes-css/app/nested/page.tsx
@@ -0,0 +1,14 @@
+import Link from 'next/link'
+
+export const metadata = {
+ title: 'Nested Page',
+}
+
+export default function Page() {
+ return (
+
+ )
+}
diff --git a/test/e2e/app-dir/parallel-routes-css/app/page.tsx b/test/e2e/app-dir/parallel-routes-css/app/page.tsx
new file mode 100644
index 0000000000000..8b7a4d47f02b6
--- /dev/null
+++ b/test/e2e/app-dir/parallel-routes-css/app/page.tsx
@@ -0,0 +1,15 @@
+import Link from 'next/link'
+import styles from './style.module.css'
+
+export const metadata = {
+ title: 'Home Page',
+}
+
+export default function Home() {
+ return (
+
+ Main
+ Nested Page
+
+ )
+}
diff --git a/test/e2e/app-dir/parallel-routes-css/app/style.module.css b/test/e2e/app-dir/parallel-routes-css/app/style.module.css
new file mode 100644
index 0000000000000..74c611f0ba380
--- /dev/null
+++ b/test/e2e/app-dir/parallel-routes-css/app/style.module.css
@@ -0,0 +1,3 @@
+.bgBlue {
+ background-color: blue;
+}
diff --git a/test/e2e/app-dir/parallel-routes-css/parallel-routes-css.test.ts b/test/e2e/app-dir/parallel-routes-css/parallel-routes-css.test.ts
new file mode 100644
index 0000000000000..5b9945817c6f4
--- /dev/null
+++ b/test/e2e/app-dir/parallel-routes-css/parallel-routes-css.test.ts
@@ -0,0 +1,50 @@
+import { nextTestSetup } from 'e2e-utils'
+import type { BrowserInterface } from 'next-webdriver'
+
+describe('parallel-routes-catchall-css', () => {
+ const { next } = nextTestSetup({
+ files: __dirname,
+ })
+
+ async function getChildrenBackgroundColor(browser: BrowserInterface) {
+ return browser.eval(
+ `window.getComputedStyle(document.getElementById('main')).backgroundColor`
+ )
+ }
+
+ async function getSlotBackgroundColor(browser: BrowserInterface) {
+ return browser.eval(
+ `window.getComputedStyle(document.getElementById('slot')).backgroundColor`
+ )
+ }
+
+ it('should properly load the Head content from multiple leaf segments', async () => {
+ const browser = await next.browser('/')
+
+ // the page background should be blue
+ expect(await getChildrenBackgroundColor(browser)).toBe('rgb(0, 0, 255)')
+
+ expect(await browser.elementByCss('title').text()).toBe('Home Page')
+ expect(await browser.elementsByCss('title')).toHaveLength(1)
+
+ // navigate to the page that matches a parallel route
+ await browser.elementByCss("[href='/nested']").click()
+ await browser.waitForElementByCss('#slot')
+
+ // the slot's background color should be red
+ expect(await getSlotBackgroundColor(browser)).toBe('rgb(255, 0, 0)')
+
+ // there should no longer be a main element
+ expect(await browser.hasElementByCssSelector('#main')).toBeFalsy()
+
+ // the slot background should still be red on a fresh load
+ await browser.refresh()
+ expect(await getSlotBackgroundColor(browser)).toBe('rgb(255, 0, 0)')
+
+ // when we navigate from the route that matched the catch-all, we should see the CSS for the main element
+ await browser.elementByCss("[href='/']").click()
+ await browser.waitForElementByCss('#main')
+
+ expect(await getChildrenBackgroundColor(browser)).toBe('rgb(0, 0, 255)')
+ })
+})
diff --git a/test/turbopack-build-tests-manifest.json b/test/turbopack-build-tests-manifest.json
index bc6f5c8891678..cc3b369088c45 100644
--- a/test/turbopack-build-tests-manifest.json
+++ b/test/turbopack-build-tests-manifest.json
@@ -2415,6 +2415,15 @@
"flakey": [],
"runtimeError": false
},
+ "test/e2e/app-dir/parallel-routes-css/parallel-routes-css.test.ts": {
+ "passed": [],
+ "failed": [
+ "parallel-routes-catchall-css should properly load the Head content from multiple leaf segments"
+ ],
+ "pending": [],
+ "flakey": [],
+ "runtimeError": false
+ },
"test/e2e/app-dir/parallel-routes-layouts/parallel-routes-layouts.test.ts": {
"passed": [
"parallel-routes-layouts should properly render layouts for multiple slots"