9313c51bc4
Introduce a new way to search for `not-found` component that based on the request pathname and current loader tree of that route. And we search the proper not-found in the finall catch closure of app rendering, so that we don't have to pass down the root layout to app-router to create the extra error boundary. This ensures the root layout doesn't have duplicated rendering for normal requests Fixes NEXT-1220 Fixes #49115
19 lines
527 B
TypeScript
19 lines
527 B
TypeScript
import { createNextDescribe } from 'e2e-utils'
|
|
|
|
createNextDescribe(
|
|
'app-dir root layout render once',
|
|
{
|
|
files: __dirname,
|
|
skipDeployment: true,
|
|
},
|
|
({ next }) => {
|
|
it('should only render root layout once', async () => {
|
|
let $ = await next.render$('/render-once')
|
|
expect($('#counter').text()).toBe('0')
|
|
$ = await next.render$('/render-once')
|
|
expect($('#counter').text()).toBe('1')
|
|
$ = await next.render$('/render-once')
|
|
expect($('#counter').text()).toBe('2')
|
|
})
|
|
}
|
|
)
|