@@ -258,6 +258,43 @@ test.describe("Login", () => {
258
258
259
259
await expect ( h1 . locator ( ".mx_CompleteSecurity_skip" ) ) . toHaveCount ( 0 ) ;
260
260
} ) ;
261
+
262
+ test ( "Continues to show verification prompt after cancelling device verification" , async ( {
263
+ page,
264
+ homeserver,
265
+ request,
266
+ credentials,
267
+ } ) => {
268
+ // Fake a different device, so we need to verify this one
269
+ console . log ( `uid ${ credentials . userId } body` , DEVICE_SIGNING_KEYS_BODY ) ;
270
+ const res = await request . post (
271
+ `${ homeserver . baseUrl } /_matrix/client/v3/keys/device_signing/upload` ,
272
+ {
273
+ headers : { Authorization : `Bearer ${ credentials . accessToken } ` } ,
274
+ data : DEVICE_SIGNING_KEYS_BODY ,
275
+ } ,
276
+ ) ;
277
+ if ( res . status ( ) / 100 !== 2 ) {
278
+ console . log ( "Uploading dummy keys failed" , await res . json ( ) ) ;
279
+ }
280
+ expect ( res . status ( ) / 100 ) . toEqual ( 2 ) ;
281
+
282
+ // Load the page and see that we are asked to verify
283
+ await page . goto ( "/" ) ;
284
+ await login ( page , homeserver , credentials ) ;
285
+ let h1 = page . getByRole ( "heading" , { name : "Verify this device" , level : 1 } ) ;
286
+ await expect ( h1 ) . toBeVisible ( ) ;
287
+
288
+ // Click "Verify with another device"
289
+ await page . getByRole ( "button" , { name : "Verify with another device" } ) . click ( ) ;
290
+
291
+ // Cancel the new dialog
292
+ await page . getByRole ( "button" , { name : "Close dialog" } ) . click ( ) ;
293
+
294
+ // Check that we are still being asked to verify
295
+ h1 = page . getByRole ( "heading" , { name : "Verify this device" , level : 1 } ) ;
296
+ await expect ( h1 ) . toBeVisible ( ) ;
297
+ } ) ;
261
298
} ) ;
262
299
} ) ;
263
300
} ) ;
0 commit comments