Change all toast rejection code to use the rejectToast utility (#33025)

This commit is contained in:
Andy Balaam
2026-05-18 17:31:52 +01:00
committed by GitHub
parent d40fe81616
commit 5be0b778db
29 changed files with 150 additions and 107 deletions
@@ -6,6 +6,8 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Com
Please see LICENSE files in the repository root for full details.
*/
import { rejectToast } from "@element-hq/element-web-playwright-common";
import { expect, test } from ".";
test.describe("Appearance user settings tab", () => {
@@ -14,10 +16,10 @@ test.describe("Appearance user settings tab", () => {
});
test.describe("Theme Choice Panel", () => {
test.beforeEach(async ({ app, user, util }) => {
test.beforeEach(async ({ app, page, user, util }) => {
// Disable the default theme for consistency in case ThemeWatcher automatically chooses it
await util.disableSystemTheme();
await app.closeVerifyToast();
await rejectToast(page, "Verify this device");
await util.openAppearanceTab();
});
@@ -104,7 +106,7 @@ test.describe("Appearance user settings tab", () => {
await expect(page).toMatchScreenshot("window-custom-theme.png");
await page.reload();
await app.closeVerifyToast();
await rejectToast(page, "Verify this device");
await util.openAppearanceTab();
// Assert that the custom theme is still selected after reloading the page