Show 'Verify this device' toast even if there are no encrypted rooms yet (#32891)

* Show 'Verify this device' toast even if there are no encrypted rooms yet

* Close verify toast in more tests
This commit is contained in:
Andy Balaam
2026-04-24 11:39:59 +00:00
committed by GitHub
parent 6c7c90c15d
commit 76b65b14de
36 changed files with 219 additions and 144 deletions
@@ -172,6 +172,7 @@ test.describe("Cryptography", function () {
"creating a DM should work, being e2e-encrypted / user verification",
{ tag: "@screenshot" },
async ({ page, app, bot: bob, user: aliceCredentials }) => {
await app.closeVerifyToast();
await app.client.bootstrapCrossSigning(aliceCredentials);
await startDMWithBob(page, bob);
// send first message
@@ -124,6 +124,7 @@ test.describe("Device verification", { tag: "@no-webkit" }, () => {
await infoDialog.getByRole("button", { name: "Got it" }).click();
// There should be no toast (other than the notifications one)
await toasts.rejectToast("Verify this device");
await toasts.rejectToast("Notifications");
await toasts.assertNoToasts();
@@ -28,12 +28,16 @@ test.describe("History sharing", function () {
// we then invite Bob, and ensure Bob can see the content.
await aliceElementApp.client.bootstrapCrossSigning(aliceCredentials);
await aliceElementApp.closeKeyStorageToast();
// Register a second user, and open it in a second instance of the app
const bobCredentials = await homeserver.registerUser(`user_${testInfo.testId}_bob`, "password", "Bob");
const bobPage = await createNewInstance(browser, bobCredentials, {}, labsFlags);
const bobElementApp = new ElementAppPage(bobPage);
await bobElementApp.client.bootstrapCrossSigning(bobCredentials);
await bobElementApp.closeKeyStorageToast();
await aliceElementApp.closeNotificationToast();
// Create the room and send a message
await createRoom(alicePage, "TestRoom", true);
@@ -84,6 +88,7 @@ test.describe("History sharing", function () {
// 5. Charlie can't see the message.
await aliceElementApp.client.bootstrapCrossSigning(aliceCredentials);
await aliceElementApp.closeKeyStorageToast();
await createRoom(alicePage, "TestRoom", true);
// Register a second user, and open it in a second instance of the app
@@ -91,6 +96,7 @@ test.describe("History sharing", function () {
const bobPage = await createNewInstance(browser, bobCredentials, {}, labsFlags);
const bobElementApp = new ElementAppPage(bobPage);
await bobElementApp.client.bootstrapCrossSigning(bobCredentials);
await bobElementApp.closeKeyStorageToast();
// ... and a third
const charlieCredentials = await homeserver.registerUser(
@@ -101,6 +107,7 @@ test.describe("History sharing", function () {
const charliePage = await createNewInstance(browser, charlieCredentials, {}, labsFlags);
const charlieElementApp = new ElementAppPage(charliePage);
await charlieElementApp.client.bootstrapCrossSigning(charlieCredentials);
await charlieElementApp.closeKeyStorageToast();
// Alice invites Bob, and Bob accepts
const roomId = await aliceElementApp.getCurrentRoomIdFromUrl();
@@ -31,15 +31,6 @@ test.describe("Key storage out of sync toast", () => {
await logIntoElementAndVerify(page, credentials, recoveryKey.encodedPrivateKey);
await deleteCachedSecrets(page);
// We won't be prompted for crypto setup unless we have an e2e room, so make one
await page
.getByRole("navigation", { name: "Room list" })
.getByRole("button", { name: "New conversation" })
.click();
await page.getByRole("menuitem", { name: "New room" }).click();
await page.getByRole("textbox", { name: "Name" }).fill("Test room");
await page.getByRole("button", { name: "Create room" }).click();
});
test("should prompt for recovery key if 'enter recovery key' pressed", { tag: "@screenshot" }, async ({ page }) => {