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

Commit b505828

Browse files
authored
update test to work with newer Rust crypto (#32)
1 parent 6b384fe commit b505828

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

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

+15-3
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,12 @@ test.describe("Cryptography", function () {
4141
});
4242
});
4343

44-
test("should show the correct shield on e2e events", async ({ page, app, bot: bob, homeserver }) => {
44+
test("should show the correct shield on e2e events", async ({
45+
page,
46+
app,
47+
bot: bob,
48+
homeserver,
49+
}, workerInfo) => {
4550
// Bob has a second, not cross-signed, device
4651
const bobSecondDevice = new Bot(page, homeserver, {
4752
bootstrapSecretStorage: false,
@@ -117,7 +122,10 @@ test.describe("Cryptography", function () {
117122
await lastTileE2eIcon.focus();
118123
await expect(page.getByRole("tooltip")).toContainText("Encrypted by a device not verified by its owner.");
119124

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

@@ -148,7 +156,11 @@ test.describe("Cryptography", function () {
148156
await expect(last).toContainText("test encrypted from unverified");
149157
await expect(lastE2eIcon).toHaveClass(/mx_EventTile_e2eIcon_warning/);
150158
await lastE2eIcon.focus();
151-
await expect(page.getByRole("tooltip")).toContainText("Encrypted by an unknown or deleted device.");
159+
await expect(page.getByRole("tooltip")).toContainText(
160+
workerInfo.project.name === "Legacy Crypto"
161+
? "Encrypted by an unknown or deleted device."
162+
: "Encrypted by a device not verified by its owner.",
163+
);
152164
});
153165

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

0 commit comments

Comments
 (0)