-
Notifications
You must be signed in to change notification settings - Fork 27.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: pages not visible in dev when named
children
(#54007)
`getEntryKey` had some logic to remove `children` if it was part of the entry (originally it was intended to fix an issue with parallel slots that were used in place of a page, but wasn't working as intended). However, this breaks pages that are named `children`. Updating this again to implement what I think was the intended behavior in 4900fa2 which is to point to the correct entry when a parallel slot is used in place of a page component. - x-ref: #52362 Closes NEXT-1514 Fixes #53072
- Loading branch information
Showing
5 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function Page(props) { | ||
return <p id="children-page">children - app</p> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default function RootLayout({ children }) { | ||
return ( | ||
<html> | ||
<body>{children}</body> | ||
</html> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { createNextDescribe } from 'e2e-utils' | ||
|
||
createNextDescribe( | ||
'children-page', | ||
{ | ||
files: __dirname, | ||
}, | ||
({ next }) => { | ||
describe('with app dir', () => { | ||
it('should show the content if you have a page named children', async () => { | ||
const browser = await next.browser('/children') | ||
|
||
const text = await browser.waitForElementByCss('#children-page').text() | ||
|
||
expect(text).toBe('children - app') | ||
|
||
const currentDisplay = await browser.eval( | ||
`window.getComputedStyle(document.querySelector('body')).display` | ||
) | ||
|
||
expect(currentDisplay).toBe('block') | ||
}) | ||
}) | ||
|
||
describe('with pages dir', () => { | ||
it('should show the content if you have a page named children', async () => { | ||
const browser = await next.browser('/other/children') | ||
|
||
const text = await browser.waitForElementByCss('#children-page').text() | ||
|
||
expect(text).toBe('children - pages') | ||
|
||
const currentDisplay = await browser.eval( | ||
`window.getComputedStyle(document.querySelector('body')).display` | ||
) | ||
|
||
expect(currentDisplay).toBe('block') | ||
}) | ||
}) | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function Page(props) { | ||
return <p id="children-page">children - pages</p> | ||
} |