Skip to content

Commit 53065f9

Browse files
authored
Add E2E test for quick settings dialog (#29441)
* Update quick settings menu to use a11y roles. * Add e2e test to test quick menu rendering * Use a testid for now. * lint lint * Revert aria changes * revert managed * write screenshot
1 parent 179b368 commit 53065f9

3 files changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
Copyright 2025 New Vector Ltd.
3+
4+
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
5+
Please see LICENSE files in the repository root for full details.
6+
*/
7+
8+
import { test, expect } from "../../element-web-test";
9+
10+
test.describe("Quick settings menu", () => {
11+
test("should be rendered properly", { tag: "@screenshot" }, async ({ app, page, user }) => {
12+
await page.getByRole("button", { name: "Quick settings" }).click();
13+
// Assert that the top heading is renderedc
14+
const settings = page.getByTestId("quick-settings-menu");
15+
await expect(settings).toBeVisible();
16+
await expect(settings).toMatchScreenshot("quick-settings.png");
17+
});
18+
});
16.2 KB
Loading

src/components/views/spaces/QuickSettingsButton.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ const QuickSettingsButton: React.FC<{
5151
wrapperClassName={classNames("mx_QuickSettingsButton_ContextMenuWrapper", {
5252
mx_QuickSettingsButton_ContextMenuWrapper_new_room_list: newRoomListEnabled,
5353
})}
54+
// Eventually replace with a properly aria-labelled menu
55+
data-testid="quick-settings-menu"
5456
onFinished={closeMenu}
5557
managed={false}
5658
focusLock={true}

0 commit comments

Comments
 (0)