@@ -95,6 +95,49 @@ test.describe('severity-1 #smoke', () => {
9595 await expect ( deleteAccount . tooltip ) . toHaveText ( 'Incorrect password' ) ;
9696 } ) ;
9797
98+ test ( 'passwordless account sees "Delete account" button (not "Continue") and can delete without password step' , async ( {
99+ target,
100+ pages : { page, signin, signinPasswordlessCode, settings, deleteAccount } ,
101+ testAccountTracker,
102+ } ) => {
103+ // Passwordless accounts skip Step 2 (password entry). The Step 1 button
104+ // must therefore read "Delete account" with a destructive style, not
105+ // "Continue", since clicking it deletes immediately.
106+ const { email } = await testAccountTracker . signUpPasswordless ( ) ;
107+
108+ await signin . clearCache ( ) ;
109+ await page . goto (
110+ `${ target . contentServerUrl } /signin?email=${ encodeURIComponent ( email ) } `
111+ ) ;
112+ await page . waitForURL ( / s i g n i n _ p a s s w o r d l e s s _ c o d e / ) ;
113+
114+ const code = await target . emailClient . getPasswordlessSigninCode ( email ) ;
115+ await signinPasswordlessCode . fillOutCodeForm ( code ) ;
116+ await expect ( settings . settingsHeading ) . toBeVisible ( ) ;
117+
118+ await settings . deleteAccountButton . click ( ) ;
119+
120+ await expect ( deleteAccount . deleteAccountHeading ) . toBeVisible ( ) ;
121+ // Passwordless accounts have no Step 1 of 2 subtitle
122+ await expect ( deleteAccount . step1Heading ) . toBeHidden ( ) ;
123+ // The primary "Continue" button must not exist for passwordless accounts
124+ await expect ( deleteAccount . continueButton ) . toBeHidden ( ) ;
125+
126+ await deleteAccount . checkAllBoxes ( ) ;
127+
128+ // Assert the button reads "Delete account" and uses the destructive style
129+ await expect ( deleteAccount . passwordlessDeleteButton ) . toBeVisible ( ) ;
130+ await expect ( deleteAccount . passwordlessDeleteButton ) . toBeEnabled ( ) ;
131+ await expect ( deleteAccount . passwordlessDeleteButton ) . toHaveClass (
132+ / c t a - c a u t i o n /
133+ ) ;
134+
135+ await deleteAccount . passwordlessDeleteButton . click ( ) ;
136+
137+ // Account should be deleted immediately without prompting for a password
138+ await expect ( page . getByText ( 'Account deleted successfully' ) ) . toBeVisible ( ) ;
139+ } ) ;
140+
98141 test ( 'delete account A then sign in with account B, no apollo cache pollution' , async ( {
99142 target,
100143 pages : { page, deleteAccount, settings, signin } ,
0 commit comments