@@ -20,7 +20,7 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withEmailCodes] })('sign out
20
20
await app . teardown ( ) ;
21
21
} ) ;
22
22
23
- test ( 'sign out throught all open tabs at once' , async ( { page, context } ) => {
23
+ test ( 'sign out through all open tabs at once' , async ( { page, context } ) => {
24
24
const mainTab = createTestUtils ( { app, page, context } ) ;
25
25
await mainTab . po . signIn . goTo ( ) ;
26
26
await mainTab . po . signIn . setIdentifier ( fakeUser . email ) ;
@@ -46,7 +46,7 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withEmailCodes] })('sign out
46
46
await mainTab . po . expect . toBeSignedOut ( ) ;
47
47
} ) ;
48
48
49
- test ( 'sign out destroying client' , async ( { page, context } ) => {
49
+ test ( 'sign out persisting client' , async ( { page, context } ) => {
50
50
const u = createTestUtils ( { app, page, context } ) ;
51
51
await u . po . signIn . goTo ( ) ;
52
52
await u . po . signIn . setIdentifier ( fakeUser . email ) ;
@@ -55,21 +55,23 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withEmailCodes] })('sign out
55
55
await u . po . signIn . continue ( ) ;
56
56
await u . po . expect . toBeSignedIn ( ) ;
57
57
await u . page . goToAppHome ( ) ;
58
-
59
- await u . page . waitForSelector ( 'p[data-clerk-id]' , { state : 'attached' } ) ;
58
+ const client_id_element = await u . page . waitForSelector ( 'p[data-clerk-id]' , { state : 'attached' } ) ;
59
+ const client_id = await client_id_element . innerHTML ( ) ;
60
60
61
61
await u . page . evaluate ( async ( ) => {
62
62
await window . Clerk . signOut ( ) ;
63
63
} ) ;
64
64
65
65
await u . po . expect . toBeSignedOut ( ) ;
66
- await u . page . waitForSelector ( 'p[data-clerk-id]' , { state : 'detached' } ) ;
67
66
await u . page . waitForSelector ( 'p[data-clerk-session]' , { state : 'detached' } ) ;
67
+
68
+ const client_id_after_sign_out = await u . page . locator ( 'p[data-clerk-id]' ) . innerHTML ( ) ;
69
+ expect ( client_id ) . toEqual ( client_id_after_sign_out ) ;
68
70
} ) ;
69
71
} ) ;
70
72
71
- testAgainstRunningApps ( { withEnv : [ appConfigs . envs . withEmailCodes_persist_client ] } ) (
72
- 'sign out with persistClient smoke test @generic' ,
73
+ testAgainstRunningApps ( { withEnv : [ appConfigs . envs . withEmailCodes_destroy_client ] } ) (
74
+ 'sign out with destroy client smoke test @generic' ,
73
75
( { app } ) => {
74
76
test . describe . configure ( { mode : 'serial' } ) ;
75
77
@@ -86,7 +88,7 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withEmailCodes_persist_client
86
88
await app . teardown ( ) ;
87
89
} ) ;
88
90
89
- test ( 'sign out persisting client' , async ( { page, context } ) => {
91
+ test ( 'sign out destroying client' , async ( { page, context } ) => {
90
92
const u = createTestUtils ( { app, page, context } ) ;
91
93
await u . po . signIn . goTo ( ) ;
92
94
await u . po . signIn . setIdentifier ( fakeUser . email ) ;
@@ -95,18 +97,16 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withEmailCodes_persist_client
95
97
await u . po . signIn . continue ( ) ;
96
98
await u . po . expect . toBeSignedIn ( ) ;
97
99
await u . page . goToAppHome ( ) ;
98
- const client_id_element = await u . page . waitForSelector ( 'p[data-clerk-id]' , { state : 'attached' } ) ;
99
- const client_id = await client_id_element . innerHTML ( ) ;
100
+
101
+ await u . page . waitForSelector ( 'p[data-clerk-id]' , { state : 'attached' } ) ;
100
102
101
103
await u . page . evaluate ( async ( ) => {
102
104
await window . Clerk . signOut ( ) ;
103
105
} ) ;
104
106
105
107
await u . po . expect . toBeSignedOut ( ) ;
108
+ await u . page . waitForSelector ( 'p[data-clerk-id]' , { state : 'detached' } ) ;
106
109
await u . page . waitForSelector ( 'p[data-clerk-session]' , { state : 'detached' } ) ;
107
-
108
- const client_id_after_sign_out = await u . page . locator ( 'p[data-clerk-id]' ) . innerHTML ( ) ;
109
- expect ( client_id ) . toEqual ( client_id_after_sign_out ) ;
110
110
} ) ;
111
111
} ,
112
112
) ;
0 commit comments