Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit a5a5385

Browse files
committed
update test to work with newer Rust crypto
1 parent 33c9c04 commit a5a5385

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

playwright/e2e/crypto/event-shields.spec.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ test.describe("Cryptography", function () {
4949
});
5050
});
5151

52-
test("should show the correct shield on e2e events", async ({ page, app, bot: bob, homeserver }) => {
52+
test("should show the correct shield on e2e events", async ({ page, app, bot: bob, homeserver }, workerInfo) => {
5353
// Bob has a second, not cross-signed, device
5454
const bobSecondDevice = new Bot(page, homeserver, {
5555
bootstrapSecretStorage: false,
@@ -125,7 +125,10 @@ test.describe("Cryptography", function () {
125125
await lastTileE2eIcon.focus();
126126
await expect(page.getByRole("tooltip")).toContainText("Encrypted by a device not verified by its owner.");
127127

128-
/* Should show a grey padlock for a message from an unknown device */
128+
/* In legacy crypto: should show a grey padlock for a message from a deleted device.
129+
* In rust crypto: should show a red padlock for a message from an unverified device.
130+
* Rust crypto remembers the verification state of the sending device, so it will know that the device was
131+
* unverified, even if it gets deleted. */
129132
// bob deletes his second device
130133
await bobSecondDevice.evaluate((cli) => cli.logout(true));
131134

@@ -156,7 +159,11 @@ test.describe("Cryptography", function () {
156159
await expect(last).toContainText("test encrypted from unverified");
157160
await expect(lastE2eIcon).toHaveClass(/mx_EventTile_e2eIcon_warning/);
158161
await lastE2eIcon.focus();
159-
await expect(page.getByRole("tooltip")).toContainText("Encrypted by an unknown or deleted device.");
162+
await expect(page.getByRole("tooltip")).toContainText(
163+
workerInfo.project.name === "Legacy Crypto" ?
164+
"Encrypted by an unknown or deleted device." :
165+
"Encrypted by a device not verified by its owner."
166+
);
160167
});
161168

162169
test("Should show a grey padlock for a key restored from backup", async ({

0 commit comments

Comments
 (0)