1- import { test } from '@playwright/test' ;
1+ import { expect , test } from '@playwright/test' ;
22
33import { hash } from '../models/helpers' ;
44import { appConfigs } from '../presets' ;
@@ -28,6 +28,13 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withSessionTasksResetPassword
2828 await u . po . signIn . setPassword ( user . password ) ;
2929 await u . po . signIn . continue ( ) ;
3030
31+ await expect (
32+ u . page . getByText (
33+ "Your password appears to have been compromised or it's no longer trusted and cannot be used. Please use another method to continue." ,
34+ ) ,
35+ ) . toBeVisible ( ) ;
36+ await u . po . signIn . getAltMethodsEmailCodeButton ( ) . click ( ) ;
37+
3138 await u . page . getByRole ( 'textbox' , { name : 'code' } ) . click ( ) ;
3239 await u . page . keyboard . type ( '424242' , { delay : 100 } ) ;
3340
@@ -62,7 +69,8 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withSessionTasksResetPassword
6269 await u . services . users . passwordUntrusted ( createdUser . id ) ;
6370 const fakeOrganization = u . services . organizations . createFakeOrganization ( ) ;
6471 await u . services . organizations . createBapiOrganization ( {
65- ...fakeOrganization ,
72+ name : fakeOrganization . name ,
73+ slug : fakeOrganization . slug + Date . now ( ) . toString ( ) ,
6674 createdBy : createdUser . id ,
6775 } ) ;
6876
@@ -73,9 +81,15 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withSessionTasksResetPassword
7381 await u . po . signIn . setPassword ( user . password ) ;
7482 await u . po . signIn . continue ( ) ;
7583
76- await u . page . getByRole ( 'textbox' , { name : 'code' } ) . fill ( '424242' ) ;
84+ await expect (
85+ u . page . getByText (
86+ "Your password appears to have been compromised or it's no longer trusted and cannot be used. Please use another method to continue." ,
87+ ) ,
88+ ) . toBeVisible ( ) ;
89+ await u . po . signIn . getAltMethodsEmailCodeButton ( ) . click ( ) ;
7790
78- await u . po . expect . toBeSignedIn ( ) ;
91+ await u . page . getByRole ( 'textbox' , { name : 'code' } ) . click ( ) ;
92+ await u . page . keyboard . type ( '424242' , { delay : 100 } ) ;
7993
8094 // Redirects back to tasks when accessing protected route by `auth.protect`
8195 await u . page . goToRelative ( '/page-protected' ) ;
0 commit comments