Skip to content

Commit 4b5000b

Browse files
committed
add failure tests
1 parent 0a0b516 commit 4b5000b

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/**
22
* @type {import('next').NextConfig}
33
*/
4-
const nextConfig = {
5-
pageExtensions: ['tsx', 'ts'],
6-
}
4+
const nextConfig = {}
75

86
module.exports = nextConfig

test/e2e/app-dir/parallel-routes-not-found/parallel-routes-not-found.test.ts

+17-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { nextTestSetup } from 'e2e-utils'
22

3+
const isPPR = process.env.__NEXT_EXPERIMENTAL_PPR === 'true'
4+
35
describe('parallel-routes-and-interception', () => {
46
const { next, skipped } = nextTestSetup({
57
files: __dirname,
@@ -22,7 +24,20 @@ describe('parallel-routes-and-interception', () => {
2224
// we also check that the #children-slot id is not present
2325
expect(await browser.hasElementByCssSelector('#children-slot')).toBe(false)
2426

25-
const $ = await next.render$('/')
26-
expect($('title').text()).toBe('layout title')
27+
if (isPPR) {
28+
let $ = await next.render$('/')
29+
expect($('title').text()).toBe('layout title')
30+
} else {
31+
const $ = await next.render$('/')
32+
expect($('title').text()).toBe('layout title')
33+
}
34+
})
35+
36+
it('should render the title once for the non-existed route', async () => {
37+
const browser = await next.browser('/non-existed')
38+
const titles = await browser.elementsByCss('title')
39+
40+
// FIXME: (metadata), the title should only be rendered once and using the not-found title
41+
expect(titles).toHaveLength(3)
2742
})
2843
})

0 commit comments

Comments
 (0)