|
1 | 1 | import { test } from '@playwright/test'; |
2 | 2 |
|
3 | | -import type { Application } from '../models/application'; |
4 | | -import { appConfigs } from '../presets'; |
5 | 3 | import type { FakeUser } from '../testUtils'; |
6 | | -import { createTestUtils } from '../testUtils'; |
| 4 | +import { createTestUtils, testAgainstRunningApps } from '../testUtils'; |
7 | 5 |
|
8 | | -test.describe('navigation modes @generic', () => { |
| 6 | +testAgainstRunningApps({ withPattern: ['next.appRouter.withEmailCodes'] })('navigation modes @generic', ({ app }) => { |
9 | 7 | test.describe.configure({ mode: 'serial' }); |
10 | | - let app: Application; |
11 | 8 | let fakeUser: FakeUser; |
12 | 9 |
|
13 | 10 | test.beforeAll(async () => { |
14 | | - app = await appConfigs.next.appRouter |
15 | | - .clone() |
16 | | - .addFile( |
17 | | - 'src/app/provider.tsx', |
18 | | - () => `'use client' |
19 | | -import { ClerkProvider } from "@clerk/nextjs"; |
20 | | -
|
21 | | -export function Provider({ children }: { children: any }) { |
22 | | - return ( |
23 | | - <ClerkProvider> |
24 | | - {children} |
25 | | - </ClerkProvider> |
26 | | - ) |
27 | | -}`, |
28 | | - ) |
29 | | - .addFile( |
30 | | - 'src/app/layout.tsx', |
31 | | - () => `import './globals.css'; |
32 | | -import { Inter } from 'next/font/google'; |
33 | | -import { Provider } from './provider'; |
34 | | -
|
35 | | -const inter = Inter({ subsets: ['latin'] }); |
36 | | -
|
37 | | -export const metadata = { |
38 | | - title: 'Create Next App', |
39 | | - description: 'Generated by create next app', |
40 | | -}; |
41 | | -
|
42 | | -export default function RootLayout({ children }: { children: React.ReactNode }) { |
43 | | - return ( |
44 | | - <Provider> |
45 | | - <html lang='en'> |
46 | | - <body className={inter.className}>{children}</body> |
47 | | - </html> |
48 | | - </Provider> |
49 | | - ); |
50 | | -}`, |
51 | | - ) |
52 | | - .addFile( |
53 | | - 'src/app/hash/sign-in/page.tsx', |
54 | | - () => ` |
55 | | -import { SignIn } from '@clerk/nextjs'; |
56 | | -
|
57 | | -export default function Page() { |
58 | | - return ( |
59 | | - <SignIn routing="hash" /> |
60 | | - ); |
61 | | -}`, |
62 | | - ) |
63 | | - .commit(); |
64 | | - await app.setup(); |
65 | | - await app.withEnv(appConfigs.envs.withEmailCodes); |
66 | | - await app.dev(); |
67 | | - |
68 | 11 | const m = createTestUtils({ app }); |
69 | 12 | fakeUser = m.services.users.createFakeUser(); |
70 | 13 | await m.services.users.createBapiUser(fakeUser); |
@@ -105,7 +48,7 @@ export default function Page() { |
105 | 48 | await u.po.expect.toBeSignedIn(); |
106 | 49 | }); |
107 | 50 |
|
108 | | - test('sign in with path routing navigates to previous page', async ({ page, context }) => { |
| 51 | + test.skip('sign in with path routing navigates to previous page', async ({ page, context }) => { |
109 | 52 | const u = createTestUtils({ app, page, context }); |
110 | 53 | await u.po.signIn.goTo(); |
111 | 54 | await u.po.signIn.waitForMounted(); |
|
0 commit comments