@@ -3,15 +3,13 @@ import { expect, test } from '@playwright/test';
3
3
import { appConfigs } from '../presets' ;
4
4
import type { FakeUser } from '../testUtils' ;
5
5
import { createTestUtils , testAgainstRunningApps } from '../testUtils' ;
6
- import type { FakeOrganization } from '../testUtils/organizationsService' ;
7
6
8
7
testAgainstRunningApps ( { withEnv : [ appConfigs . envs . withSessionTasks ] } ) (
9
8
'session tasks after sign-up flow @nextjs' ,
10
9
( { app } ) => {
11
10
test . describe . configure ( { mode : 'serial' } ) ;
12
11
13
12
let fakeUser : FakeUser ;
14
- let fakeOrganization : FakeOrganization ;
15
13
16
14
test . beforeAll ( ( ) => {
17
15
const u = createTestUtils ( { app } ) ;
@@ -20,7 +18,6 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withSessionTasks] })(
20
18
withPhoneNumber : true ,
21
19
withUsername : true ,
22
20
} ) ;
23
- fakeOrganization = u . services . organizations . createFakeOrganization ( ) ;
24
21
} ) ;
25
22
26
23
test . afterAll ( async ( ) => {
@@ -45,6 +42,27 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withSessionTasks] })(
45
42
expect ( page . url ( ) ) . toContain ( 'tasks' ) ;
46
43
47
44
// Resolves task
45
+ const fakeOrganization = u . services . organizations . createFakeOrganization ( ) ;
46
+ await u . po . sessionTask . resolveForceOrganizationSelectionTask ( fakeOrganization ) ;
47
+ await u . po . expect . toHaveResolvedTask ( ) ;
48
+
49
+ // Navigates to after sign-up
50
+ await u . page . waitForAppUrl ( '/' ) ;
51
+ } ) ;
52
+
53
+ test ( 'with sso, navigate to task on after sign-up' , async ( { page, context } ) => {
54
+ const u = createTestUtils ( { app, page, context } ) ;
55
+
56
+ // Performs sign-up (transfer flow with sign-in) with SSO
57
+ await u . po . signIn . goTo ( ) ;
58
+ await u . page . getByRole ( 'button' , { name : 'E2E OAuth Provider' } ) . click ( ) ;
59
+ await u . page . getByText ( 'Sign in to oauth-provider' ) . waitFor ( ) ;
60
+ await u . po . signIn . setIdentifier ( fakeUser . email ) ;
61
+ await u . po . signIn . continue ( ) ;
62
+ await u . po . signIn . enterTestOtpCode ( ) ;
63
+
64
+ // Resolves task
65
+ const fakeOrganization = u . services . organizations . createFakeOrganization ( ) ;
48
66
await u . po . sessionTask . resolveForceOrganizationSelectionTask ( fakeOrganization ) ;
49
67
await u . po . expect . toHaveResolvedTask ( ) ;
50
68
0 commit comments