Files
next.js/test/e2e/app-dir/parallel-routes-not-found/parallel-routes-not-found.test.ts
Josh StoryandGitHub 79f9e67e23 Exclude static metadata and viewport from error recovery prerender when cache-components is enabled (#94134)
These functions can be dynamic however in this mode we are trying to
recover on the client so there is little point in attempting to resolve
the http error recovery metadata since it might block us producing a
shell. We now exclude these from the errore recovery RSC payload since
we will recover the metadata on hydration in the browser.
2026-05-29 13:48:41 -07:00

46 lines
1.7 KiB
TypeScript

import { nextTestSetup } from 'e2e-utils'
import { retry } from 'next-test-utils'
describe('parallel-routes-and-interception', () => {
const { next, skipped } = nextTestSetup({
files: __dirname,
// TODO: remove after deployment handling is updated
skipDeployment: true,
})
if (skipped) {
return
}
// TODO: revisit the error for missing parallel routes slot
it('should not render the @children slot when the @slot is not found', async () => {
const browser = await next.browser('/')
// we make sure the page is available through navigating
expect(await browser.elementByCss('body').text()).toMatch(
/This page could not be found/
)
// we also check that the #children-slot id is not present
expect(await browser.hasElementByCssSelector('#children-slot')).toBe(false)
await retry(async () => {
const title = await browser.eval(() => {
return document.title
})
// TODO: the fact that the title on the client (in hydration data) disagrees with the title SSRd
// when cache components is off is a sign we don't have coherent handling of notFound titles
// This test now asserts the prod client title in next start that would actually be observed
// by site visitors post hydration.
expect(title).toBe('404: This page could not be found.')
})
})
it('should render the title once for the non-existed route', async () => {
const browser = await next.browser('/non-existed')
const titles = await browser.elementsByCss('title')
// FIXME: (metadata), the title should only be rendered once and using the not-found title
expect(titles).toHaveLength(3)
})
})