Skip to content

Commit

Permalink
Wrap parallel routes tests in describe (#40546)
Browse files Browse the repository at this point in the history
Small changes:
- Group parallel routes tests
- Upgrade tests to latest react experimental
  • Loading branch information
timneutkens committed Sep 14, 2022
1 parent 46dd1cf commit 385e3f0
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 30 deletions.
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -178,8 +178,8 @@
"react-17": "npm:react@17.0.2",
"react-dom": "18.2.0",
"react-dom-17": "npm:react-dom@17.0.2",
"react-dom-exp": "npm:react-dom@0.0.0-experimental-c739cef2f-20220912",
"react-exp": "npm:react@0.0.0-experimental-c739cef2f-20220912",
"react-dom-exp": "npm:react-dom@0.0.0-experimental-e6a062bd2-20220913",
"react-exp": "npm:react@0.0.0-experimental-e6a062bd2-20220913",
"react-ssr-prepass": "1.0.8",
"react-virtualized": "9.22.3",
"relay-compiler": "13.0.2",
Expand Down
24 changes: 12 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 18 additions & 16 deletions test/e2e/app-dir/index.test.ts
Expand Up @@ -266,23 +266,25 @@ describe('app dir', () => {
}
})

it('should match parallel routes', async () => {
const html = await renderViaHTTP(next.url, '/parallel/nested')
expect(html).toContain('parallel/layout')
expect(html).toContain('parallel/@foo/nested/layout')
expect(html).toContain('parallel/@foo/nested/@a/page')
expect(html).toContain('parallel/@foo/nested/@b/page')
expect(html).toContain('parallel/@bar/nested/layout')
expect(html).toContain('parallel/@bar/nested/@a/page')
expect(html).toContain('parallel/@bar/nested/@b/page')
expect(html).toContain('parallel/nested/page')
})
describe('parallel routes', () => {
it('should match parallel routes', async () => {
const html = await renderViaHTTP(next.url, '/parallel/nested')
expect(html).toContain('parallel/layout')
expect(html).toContain('parallel/@foo/nested/layout')
expect(html).toContain('parallel/@foo/nested/@a/page')
expect(html).toContain('parallel/@foo/nested/@b/page')
expect(html).toContain('parallel/@bar/nested/layout')
expect(html).toContain('parallel/@bar/nested/@a/page')
expect(html).toContain('parallel/@bar/nested/@b/page')
expect(html).toContain('parallel/nested/page')
})

it('should match parallel routes in route groups', async () => {
const html = await renderViaHTTP(next.url, '/parallel/nested-2')
expect(html).toContain('parallel/layout')
expect(html).toContain('parallel/(new)/layout')
expect(html).toContain('parallel/(new)/@baz/nested/page')
it('should match parallel routes in route groups', async () => {
const html = await renderViaHTTP(next.url, '/parallel/nested-2')
expect(html).toContain('parallel/layout')
expect(html).toContain('parallel/(new)/layout')
expect(html).toContain('parallel/(new)/@baz/nested/page')
})
})

describe('<Link />', () => {
Expand Down

0 comments on commit 385e3f0

Please sign in to comment.