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

Commit

Permalink
update test to work with newer Rust crypto
Browse files Browse the repository at this point in the history
  • Loading branch information
uhoreg committed Sep 11, 2024
1 parent 33c9c04 commit a5a5385
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions playwright/e2e/crypto/event-shields.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ test.describe("Cryptography", function () {
});
});

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

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

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

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

0 comments on commit a5a5385

Please sign in to comment.