Skip to content

Commit a353327

Browse files
authored
Merge pull request #265 from andybalaam/andybalaam/use-reject-toast-from-utils
Use the rejectToast function from utils instead of a fixture
2 parents 68a95a6 + 71c61de commit a353327

3 files changed

Lines changed: 17 additions & 39 deletions

File tree

modules/widget-lifecycle/element-web/e2e/widget-lifecycle.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Please see LICENSE files in the repository root for full details.
66
*/
77

88
import { type SynapseContainer } from "@element-hq/element-web-playwright-common/lib/testcontainers/index.js";
9+
import { rejectToastIfExists } from "@element-hq/element-web-playwright-common";
910

1011
import { test, expect } from "../../../../playwright/element-web-test.ts";
1112

@@ -63,8 +64,8 @@ test.describe("Widget Lifecycle", () => {
6364
},
6465
});
6566

66-
test("auto-approves preload and identity", async ({ page, user, homeserver, toasts }, testInfo) => {
67-
toasts.rejectToastIfExists("Verify this device");
67+
test("auto-approves preload and identity", async ({ page, user, homeserver }, testInfo) => {
68+
rejectToastIfExists(page, "Verify this device");
6869

6970
// A bot creates a room with the widget pinned to the top panel, then invites the test user.
7071
// Because the widget was added by a different user (the bot), Element would normally show a
@@ -121,8 +122,8 @@ test.describe("Widget Lifecycle", () => {
121122
).toBeVisible();
122123
});
123124

124-
test("prompts for capabilities not in the allowlist", async ({ page, user, homeserver, toasts }, testInfo) => {
125-
toasts.rejectToastIfExists("Verify this device");
125+
test("prompts for capabilities not in the allowlist", async ({ page, user, homeserver }, testInfo) => {
126+
rejectToastIfExists(page, "Verify this device");
126127

127128
const bot = await homeserver.registerUser(`bot_${testInfo.testId}`, "password", "Bot");
128129
const { room_id: roomId } = await homeserver.csApi.request<{ room_id: string }>(
@@ -184,9 +185,8 @@ test.describe("Widget Lifecycle", () => {
184185
page,
185186
user,
186187
homeserver,
187-
toasts,
188188
}, testInfo) => {
189-
toasts.rejectToastIfExists("Verify this device");
189+
rejectToastIfExists(page, "Verify this device");
190190

191191
const bot = await homeserver.registerUser(`bot_${testInfo.testId}`, "password", "Bot");
192192
const { room_id: roomId } = await homeserver.csApi.request<{ room_id: string }>(

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"@action-validator/cli": "^0.6.0",
2828
"@action-validator/core": "^0.6.0",
2929
"@element-hq/element-web-module-api": "1.13.0",
30-
"@element-hq/element-web-playwright-common": "^4.0.0",
30+
"@element-hq/element-web-playwright-common": "^4.1.0",
3131
"@playwright/test": "^1.52.0",
3232
"@stylistic/eslint-plugin": "^5.0.0",
3333
"@types/node": "^22.12.0",

yarn.lock

Lines changed: 10 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -550,16 +550,16 @@
550550
resolved "https://registry.yarnpkg.com/@element-hq/element-web-module-api/-/element-web-module-api-1.13.0.tgz#a3e9af978ea07e7f2e3b25f7c55877bf890fff6e"
551551
integrity sha512-3QXejLpXHK52e/BM61zeFQt1pnmKEfhFsooKI3OOXa5M9io683q1eA986TquZTDHoorm0Q+4TyxjYD3j2Nkp8A==
552552

553-
"@element-hq/element-web-playwright-common@^4.0.0":
554-
version "4.0.0"
555-
resolved "https://registry.yarnpkg.com/@element-hq/element-web-playwright-common/-/element-web-playwright-common-4.0.0.tgz#3448df530f1d7d8c1268bc5c75cb86e3f36a70f6"
556-
integrity sha512-EQ68nmcXbwxif4W9QMi0l3loFmi1bDsXk3If15X+R2uZ3HVrcB7M7TMhpVgeMEpOu3YOYqFbT3ZrmaM4GlMSRg==
553+
"@element-hq/element-web-playwright-common@^4.1.0":
554+
version "4.1.0"
555+
resolved "https://registry.yarnpkg.com/@element-hq/element-web-playwright-common/-/element-web-playwright-common-4.1.0.tgz#2b8c980a6cc9bc8463f8013d7f3e8cc5d07df4cf"
556+
integrity sha512-qwgK2TEml7G4Pc8B1zhyCcRypAPhzxEKnJmz37QTLkO4LGotACpdI9CyD61jVgXwf4uY8z0+afED1Eky5AMcXA==
557557
dependencies:
558558
"@axe-core/playwright" "^4.10.1"
559559
"@testcontainers/postgresql" "^11.0.0"
560560
glob "^13.0.5"
561561
lodash-es "^4.17.23"
562-
mailpit-api "^1.2.0"
562+
mailpit-api "^2.0.0"
563563
strip-ansi "^7.1.0"
564564
testcontainers "^11.0.0"
565565
wait-on "^9.0.4"
@@ -2817,7 +2817,7 @@ axe-core@~4.11.1:
28172817
resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.11.1.tgz#052ff9b2cbf543f5595028b583e4763b40c78ea7"
28182818
integrity sha512-BASOg+YwO2C+346x3LZOeoovTIoTrRqEsqMa6fmfAV0P+U9mFr9NsyOEpiYvFjbc64NMrSswhV50WdXzdb/Z5A==
28192819

2820-
axios@^1.13.5, axios@^1.15.0:
2820+
axios@^1.15.0:
28212821
version "1.16.0"
28222822
resolved "https://registry.yarnpkg.com/axios/-/axios-1.16.0.tgz#f8e5dd931cef2a5f8c32216d5784eda2f8750eb7"
28232823
integrity sha512-6hp5CwvTPlN2A31g5dxnwAX0orzM7pmCRDLnZSX772mv8WDqICwFjowHuPs04Mc8deIld1+ejhtaMn5vp6b+1w==
@@ -4104,11 +4104,6 @@ esutils@^2.0.2:
41044104
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64"
41054105
integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==
41064106

4107-
event-target-polyfill@^0.0.4:
4108-
version "0.0.4"
4109-
resolved "https://registry.yarnpkg.com/event-target-polyfill/-/event-target-polyfill-0.0.4.tgz#060ee66e85aaedc76b6fa66079782dcc11cba496"
4110-
integrity sha512-Gs6RLjzlLRdT8X9ZipJdIZI/Y6/HhRLyq9RdDlCsnpxr/+Nn6bU2EFGuC94GjxqhM+Nmij2Vcq98yoHrU8uNFQ==
4111-
41124107
event-target-shim@^5.0.0:
41134108
version "5.0.1"
41144109
resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789"
@@ -4966,11 +4961,6 @@ isomorphic-timers-promises@^1.0.1:
49664961
resolved "https://registry.yarnpkg.com/isomorphic-timers-promises/-/isomorphic-timers-promises-1.0.1.tgz#e4137c24dbc54892de8abae3a4b5c1ffff381598"
49674962
integrity sha512-u4sej9B1LPSxTGKB/HiuzvEQnXH0ECYkSVQU39koSwmFAxhlEAFl9RdTvLv4TOTQUgBS5O3O5fwUxk6byBZ+IQ==
49684963

4969-
isomorphic-ws@^5.0.0:
4970-
version "5.0.0"
4971-
resolved "https://registry.yarnpkg.com/isomorphic-ws/-/isomorphic-ws-5.0.0.tgz#e5529148912ecb9b451b46ed44d53dae1ce04bbf"
4972-
integrity sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw==
4973-
49744964
istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.2:
49754965
version "3.2.2"
49764966
resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz#2d166c4b0644d43a39f04bf6c2edd1e585f31756"
@@ -5411,15 +5401,10 @@ magicast@^0.5.1:
54115401
"@babel/types" "^7.28.5"
54125402
source-map-js "^1.2.1"
54135403

5414-
mailpit-api@^1.2.0:
5415-
version "1.8.1"
5416-
resolved "https://registry.yarnpkg.com/mailpit-api/-/mailpit-api-1.8.1.tgz#2996b936db39440358aa87c4eb25b8a95853e3a6"
5417-
integrity sha512-nLbgP6cXIFS8U2DN6vDI3z13x1+6T198kVsX/jNwf1L6KEGJkRFCauh/pLxiW5DQoWHmVeOTLQ4scRma40uZRQ==
5418-
dependencies:
5419-
axios "^1.13.5"
5420-
isomorphic-ws "^5.0.0"
5421-
partysocket "^1.1.10"
5422-
ws "^8.18.3"
5404+
mailpit-api@^2.0.0:
5405+
version "2.0.0"
5406+
resolved "https://registry.yarnpkg.com/mailpit-api/-/mailpit-api-2.0.0.tgz#f922eaf7e06209b4b2b0ef7d367da0ce8eb1aec8"
5407+
integrity sha512-zK68B0CRVZaJS1PaX7omFhKUKSLp4JMMpAUTRYbCmcrgJ9nguIh4sS+RRUyFeW1nykDNH8PVlRz/WSXsq9ZqlQ==
54235408

54245409
make-dir@^4.0.0:
54255410
version "4.0.0"
@@ -5918,13 +5903,6 @@ parse-json@^5.0.0, parse-json@^5.2.0:
59185903
json-parse-even-better-errors "^2.3.0"
59195904
lines-and-columns "^1.1.6"
59205905

5921-
partysocket@^1.1.10:
5922-
version "1.1.16"
5923-
resolved "https://registry.yarnpkg.com/partysocket/-/partysocket-1.1.16.tgz#0c8894b8a1f370c5975bce26a1c7ceff36b0aec0"
5924-
integrity sha512-d7xFv+ZC7x0p/DAHWJ5FhxQhimIx+ucyZY+kxL0cKddLBmK9c4p2tEA/L+dOOrWm6EYrRwrBjKQV0uSzOY9x1w==
5925-
dependencies:
5926-
event-target-polyfill "^0.0.4"
5927-
59285906
patch-package@^8.0.1:
59295907
version "8.0.1"
59305908
resolved "https://registry.yarnpkg.com/patch-package/-/patch-package-8.0.1.tgz#79d02f953f711e06d1f8949c8a13e5d3d7ba1a60"

0 commit comments

Comments
 (0)