@@ -11,7 +11,7 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withSessionTasks] })(
1111
1212 let fakeUser : FakeUser ;
1313
14- test . beforeAll ( ( ) => {
14+ test . beforeEach ( ( ) => {
1515 const u = createTestUtils ( { app } ) ;
1616 fakeUser = u . services . users . createFakeUser ( {
1717 fictionalEmail : true ,
@@ -27,6 +27,12 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withSessionTasks] })(
2727 await app . teardown ( ) ;
2828 } ) ;
2929
30+ test . afterEach ( async ( { page, context } ) => {
31+ const u = createTestUtils ( { app, page, context } ) ;
32+ await u . page . signOut ( ) ;
33+ await u . page . context ( ) . clearCookies ( ) ;
34+ } ) ;
35+
3036 test ( 'navigate to task on after sign-up' , async ( { page, context } ) => {
3137 // Performs sign-up
3238 const u = createTestUtils ( { app, page, context } ) ;
@@ -51,5 +57,31 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withSessionTasks] })(
5157 // Navigates to after sign-up
5258 await u . page . waitForAppUrl ( '/' ) ;
5359 } ) ;
60+
61+ test ( 'with sso, navigate to task on after sign-up' , async ( { page, context } ) => {
62+ const u = createTestUtils ( { app, page, context } ) ;
63+
64+ await u . po . signUp . goTo ( ) ;
65+ await u . page . getByRole ( 'button' , { name : 'E2E OAuth Provider' } ) . click ( ) ;
66+
67+ await u . po . signIn . waitForMounted ( ) ;
68+ await u . po . signIn . getGoToSignUp ( ) . click ( ) ;
69+
70+ await u . po . signUp . waitForMounted ( ) ;
71+ await u . po . signUp . setEmailAddress ( fakeUser . email ) ;
72+ await u . po . signUp . continue ( ) ;
73+ await u . po . signUp . enterTestOtpCode ( ) ;
74+
75+ // Resolves task
76+ await u . po . signIn . waitForMounted ( ) ;
77+ const fakeOrganization = Object . assign ( u . services . organizations . createFakeOrganization ( ) , {
78+ slug : u . services . organizations . createFakeOrganization ( ) . slug + '-with-sign-in-sso' ,
79+ } ) ;
80+ await u . po . sessionTask . resolveForceOrganizationSelectionTask ( fakeOrganization ) ;
81+ await u . po . expect . toHaveResolvedTask ( ) ;
82+
83+ // Navigates to after sign-up
84+ await u . page . waitForAppUrl ( '/' ) ;
85+ } ) ;
5486 } ,
5587) ;
0 commit comments