Skip to content

Commit f661f0f

Browse files
committed
add failure tests
1 parent 0a0b516 commit f661f0f

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-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

+25-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,28 @@ 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('')
30+
31+
// FIXME: (metadata) we're rendering a fallback `__next_error__` page in PPR
32+
// when not found of missing slot error is thrown
33+
$ = await next.render$('/', {
34+
headers: {
35+
'User-Agent': 'Discordbot',
36+
},
37+
})
38+
} else {
39+
const $ = await next.render$('/')
40+
expect($('title').text()).toBe('layout title')
41+
}
42+
})
43+
44+
it('should render the title once for the non-existed route', async () => {
45+
const browser = await next.browser('/non-existed')
46+
const titles = await browser.elementsByCss('title')
47+
48+
// FIXME: (metadata), the title should only be rendered once and using the not-found title
49+
expect(titles).toHaveLength(3)
2750
})
2851
})

0 commit comments

Comments
 (0)