Skip to content

Commit 9b711f1

Browse files
committed
Show 'Verify this device' toast even if there are no encrypted rooms yet
1 parent cabac4e commit 9b711f1

32 files changed

Lines changed: 104 additions & 57 deletions

apps/web/playwright/e2e/accessibility/keyboard-navigation.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ test.describe("Landmark navigation tests", () => {
1515
});
1616

1717
test("without any rooms", async ({ page, homeserver, app, user }) => {
18+
await app.closeVerifyToast();
19+
1820
// sometimes the space button doesn't appear right away
1921
await expect(page.locator(".mx_SpaceButton_active")).toBeVisible();
2022

apps/web/playwright/e2e/audio-player/audio-player.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ test.describe("Audio player", { tag: ["@no-firefox", "@no-webkit"] }, () => {
144144
};
145145

146146
test.beforeEach(async ({ page, app, user }) => {
147+
await app.closeVerifyToast();
147148
await app.client.createRoom({ name: "Test Room" });
148149
await app.viewRoomByName("Test Room");
149150

apps/web/playwright/e2e/crypto/crypto.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ test.describe("Cryptography", function () {
169169
"creating a DM should work, being e2e-encrypted / user verification",
170170
{ tag: "@screenshot" },
171171
async ({ page, app, bot: bob, user: aliceCredentials }) => {
172+
await app.closeVerifyToast();
172173
await app.client.bootstrapCrossSigning(aliceCredentials);
173174
await startDMWithBob(page, bob);
174175
// send first message

apps/web/playwright/e2e/crypto/device-verification.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ test.describe("Device verification", { tag: "@no-webkit" }, () => {
122122

123123
// There should be no toast (other than the notifications one)
124124
const toasts = new Toasts(page);
125+
await toasts.rejectToast("Verify this device");
125126
await toasts.rejectToast("Notifications");
126127
await toasts.assertNoToasts();
127128

apps/web/playwright/e2e/crypto/history-sharing.spec.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,16 @@ test.describe("History sharing", function () {
2929
// we then invite Bob, and ensure Bob can see the content.
3030

3131
await aliceElementApp.client.bootstrapCrossSigning(aliceCredentials);
32+
await aliceElementApp.closeKeyStorageToast();
3233

3334
// Register a second user, and open it in a second instance of the app
3435
const bobCredentials = await homeserver.registerUser(`user_${testInfo.testId}_bob`, "password", "Bob");
3536
const bobPage = await createNewInstance(browser, bobCredentials, {}, labsFlags);
3637
const bobElementApp = new ElementAppPage(bobPage);
3738
await bobElementApp.client.bootstrapCrossSigning(bobCredentials);
39+
await bobElementApp.closeKeyStorageToast();
40+
41+
await aliceElementApp.closeNotificationToast();
3842

3943
// Create the room and send a message
4044
await createRoom(alicePage, "TestRoom", true);
@@ -85,13 +89,15 @@ test.describe("History sharing", function () {
8589
// 5. Charlie can't see the message.
8690

8791
await aliceElementApp.client.bootstrapCrossSigning(aliceCredentials);
92+
await aliceElementApp.closeKeyStorageToast();
8893
await createRoom(alicePage, "TestRoom", true);
8994

9095
// Register a second user, and open it in a second instance of the app
9196
const bobCredentials = await homeserver.registerUser(`user_${testInfo.testId}_bob`, "password", "Bob");
9297
const bobPage = await createNewInstance(browser, bobCredentials, {}, labsFlags);
9398
const bobElementApp = new ElementAppPage(bobPage);
9499
await bobElementApp.client.bootstrapCrossSigning(bobCredentials);
100+
await bobElementApp.closeKeyStorageToast();
95101

96102
// ... and a third
97103
const charlieCredentials = await homeserver.registerUser(
@@ -102,6 +108,7 @@ test.describe("History sharing", function () {
102108
const charliePage = await createNewInstance(browser, charlieCredentials, {}, labsFlags);
103109
const charlieElementApp = new ElementAppPage(charliePage);
104110
await charlieElementApp.client.bootstrapCrossSigning(charlieCredentials);
111+
await charlieElementApp.closeKeyStorageToast();
105112

106113
// Alice invites Bob, and Bob accepts
107114
const roomId = await aliceElementApp.getCurrentRoomIdFromUrl();

apps/web/playwright/e2e/crypto/toasts.spec.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,6 @@ test.describe("Key storage out of sync toast", () => {
3131
await logIntoElementAndVerify(page, credentials, recoveryKey.encodedPrivateKey);
3232

3333
await deleteCachedSecrets(page);
34-
35-
// We won't be prompted for crypto setup unless we have an e2e room, so make one
36-
await page
37-
.getByRole("navigation", { name: "Room list" })
38-
.getByRole("button", { name: "New conversation" })
39-
.click();
40-
await page.getByRole("menuitem", { name: "New room" }).click();
41-
await page.getByRole("textbox", { name: "Name" }).fill("Test room");
42-
await page.getByRole("button", { name: "Create room" }).click();
4334
});
4435

4536
test("should prompt for recovery key if 'enter recovery key' pressed", { tag: "@screenshot" }, async ({ page }) => {

apps/web/playwright/e2e/invite/invite-dialog.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ test.describe("Invite dialog", function () {
7373
"should support inviting a user to Direct Messages",
7474
{ tag: "@screenshot" },
7575
async ({ page, app, user, bot }) => {
76+
await app.closeVerifyToast();
7677
await page
7778
.getByRole("navigation", { name: "Room list" })
7879
.getByRole("button", { name: "New conversation" })

apps/web/playwright/e2e/left-panel/room-list-panel/room-list-collapse.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ test.describe("Collapsible Room list", () => {
1414
});
1515

1616
test.beforeEach(async ({ page, app, user }) => {
17+
await app.closeVerifyToast();
1718
await app.closeNotificationToast();
1819
for (let i = 0; i < 10; i++) {
1920
await app.client.createRoom({ name: `room${i}` });

apps/web/playwright/e2e/left-panel/room-list-panel/room-list-filter-sort.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ test.describe("Room list filters and sort", () => {
4646
}
4747

4848
test.beforeEach(async ({ page, app, bot, user }) => {
49-
// The notification toast is displayed above the search section
49+
// The toasts are displayed above the search section
50+
await app.closeVerifyToast();
5051
await app.closeNotificationToast();
5152
});
5253

apps/web/playwright/e2e/left-panel/room-list-panel/room-list-header.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ test.describe("Header section of the room list", () => {
2222
}
2323

2424
test.beforeEach(async ({ page, app, user }) => {
25-
// The notification toast is displayed above the search section
25+
// The toasts are displayed above the search section
26+
await app.closeVerifyToast();
2627
await app.closeNotificationToast();
2728
});
2829

0 commit comments

Comments
 (0)