@@ -13,6 +13,7 @@ import { selectHomeserver } from "../utils";
13
13
import { type Credentials , type HomeserverInstance } from "../../plugins/homeserver" ;
14
14
import { consentHomeserver } from "../../plugins/homeserver/synapse/consentHomeserver.ts" ;
15
15
import { isDendrite } from "../../plugins/homeserver/dendrite" ;
16
+ import { createBot } from "../crypto/utils.ts" ;
16
17
17
18
// This test requires fixed credentials for the device signing keys below to work
18
19
const username = "user1234" ;
@@ -258,6 +259,34 @@ test.describe("Login", () => {
258
259
259
260
await expect ( h1 . locator ( ".mx_CompleteSecurity_skip" ) ) . toHaveCount ( 0 ) ;
260
261
} ) ;
262
+
263
+ test ( "Continues to show verification prompt after cancelling device verification" , async ( {
264
+ page,
265
+ homeserver,
266
+ credentials,
267
+ } ) => {
268
+ // Create a different device which is cross-signed, meaning we need to verify this device
269
+ await createBot ( page , homeserver , credentials , true ) ;
270
+
271
+ // Wait to avoid homeserver rate limit on logins
272
+ await page . waitForTimeout ( 100 ) ;
273
+
274
+ // Load the page and see that we are asked to verify
275
+ await page . goto ( "/#/welcome" ) ;
276
+ await login ( page , homeserver , credentials ) ;
277
+ let h1 = page . getByRole ( "heading" , { name : "Verify this device" , level : 1 } ) ;
278
+ await expect ( h1 ) . toBeVisible ( ) ;
279
+
280
+ // Click "Verify with another device"
281
+ await page . getByRole ( "button" , { name : "Verify with another device" } ) . click ( ) ;
282
+
283
+ // Cancel the new dialog
284
+ await page . getByRole ( "button" , { name : "Close dialog" } ) . click ( ) ;
285
+
286
+ // Check that we are still being asked to verify
287
+ h1 = page . getByRole ( "heading" , { name : "Verify this device" , level : 1 } ) ;
288
+ await expect ( h1 ) . toBeVisible ( ) ;
289
+ } ) ;
261
290
} ) ;
262
291
} ) ;
263
292
} ) ;
0 commit comments