Skip to content

Commit c5eb09d

Browse files
committed
fixup tests
1 parent bef1a5f commit c5eb09d

File tree

3 files changed

+28
-16
lines changed

3 files changed

+28
-16
lines changed

playwright/e2e/settings/room-settings/room-security-tab.spec.ts

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,25 @@ test.describe("Roles & Permissions room settings tab", () => {
2424
settings = await app.settings.openRoomSettings("Security & Privacy");
2525
});
2626

27-
test("should be able to toggle on encryption in a room", { tag: "@screenshot" }, async ({ page, app, user }) => {
28-
await page.setViewportSize({ width: 1024, height: 1400 });
29-
const encryptedToggle = settings.getByLabel("Encrypted");
30-
await encryptedToggle.click();
31-
32-
// Accept the dialog.
33-
await page.getByRole("button", { name: "Ok " }).click();
34-
35-
await expect(encryptedToggle).toBeChecked();
36-
await expect(encryptedToggle).toBeDisabled();
37-
38-
await settings.getByLabel("Only send messages to verified users.").check();
39-
await expect(settings).toMatchScreenshot("room-security-settings.png");
40-
});
27+
test(
28+
"should be able to toggle on encryption in a room",
29+
{ tag: "@screenshot" },
30+
async ({ page, app, user, axe }) => {
31+
await page.setViewportSize({ width: 1024, height: 1400 });
32+
const encryptedToggle = settings.getByLabel("Encrypted");
33+
await encryptedToggle.click();
34+
35+
// Accept the dialog.
36+
await page.getByRole("button", { name: "Ok " }).click();
37+
38+
await expect(encryptedToggle).toBeChecked();
39+
await expect(encryptedToggle).toBeDisabled();
40+
41+
await settings.getByLabel("Only send messages to verified users.").check();
42+
43+
axe.disableRules("color-contrast"); // XXX: Inheriting colour contrast issues from room view.
44+
await expect(axe).toHaveNoViolations();
45+
await expect(settings).toMatchScreenshot("room-security-settings.png");
46+
},
47+
);
4148
});

playwright/e2e/settings/room-settings/room-video-tab.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,12 @@ test.describe("Voice & Video room settings tab", () => {
3030
test(
3131
"should be able to toggle on Element Call in the room",
3232
{ tag: "@screenshot" },
33-
async ({ page, app, user }) => {
33+
async ({ page, app, user, axe }) => {
3434
await page.setViewportSize({ width: 1024, height: 1400 });
3535
const callToggle = settings.getByLabel("Enable Element Call as an additional calling option in this room");
3636
await callToggle.check();
37+
axe.disableRules("color-contrast"); // XXX: Inheriting colour contrast issues from room view.
38+
await expect(axe).toHaveNoViolations();
3739
await expect(settings).toMatchScreenshot("room-video-settings.png");
3840
},
3941
);

playwright/e2e/spaces/spaces.spec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,13 +370,16 @@ test.describe("Spaces", () => {
370370
await expect(page.locator(".mx_SpaceRoomView")).toMatchScreenshot("space-room-view.png");
371371
});
372372

373-
test("should render spaces visibility settings", { tag: "@screenshot" }, async ({ page, app, user, bot }) => {
373+
test("should render spaces visibility settings", { tag: "@screenshot" }, async ({ page, app, user, axe }) => {
374374
await app.client.createSpace({
375375
name: "My Space",
376376
});
377377
await app.viewSpaceByName("My space");
378378
await page.getByLabel("Settings", { exact: true }).click();
379379
await app.settings.switchTab("Visibility");
380+
381+
axe.disableRules("color-contrast"); // XXX: Inheriting colour contrast issues from room view.
382+
await expect(axe).toHaveNoViolations();
380383
await expect(page.locator("#mx_tabpanel_SPACE_VISIBILITY_TAB")).toMatchScreenshot(
381384
"space-visibility-settings.png",
382385
);

0 commit comments

Comments
 (0)