Skip to content

Commit 8bd4434

Browse files
authored
Merge pull request #3164 from element-hq/toger5/fix-src-js-sdk-imports
Fix lint and playwright errors caused by matrix-js-sdk/src import
2 parents 9acc1d1 + 9b945d0 commit 8bd4434

File tree

4 files changed

+28
-4
lines changed

4 files changed

+28
-4
lines changed

backend/ew.test.config.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
"preferred_domain": "meet.element.io"
4747
},
4848
"element_call": {
49-
"url": "https://localhost:3000",
5049
"participant_limit": 8,
5150
"brand": "Element Call"
5251
},

dev-backend-docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ services:
7070

7171
element-web:
7272
image: ghcr.io/element-hq/element-web:develop
73+
pull_policy: always
7374
volumes:
7475
- ./backend/ew.test.config.json:/app/config.json
7576
environment:

playwright/fixtures/widget-user.ts

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

88
import { type Page, test, expect, type JSHandle } from "@playwright/test";
99

10-
import type { MatrixClient } from "matrix-js-sdk/src";
10+
import type { MatrixClient } from "matrix-js-sdk";
1111

1212
export type UserBaseFixture = {
1313
mxId: string;
@@ -36,7 +36,6 @@ const CONFIG_JSON = {
3636
},
3737

3838
element_call: {
39-
url: "https://localhost:3000",
4039
participant_limit: 8,
4140
brand: "Element Call",
4241
},
@@ -60,6 +59,21 @@ const CONFIG_JSON = {
6059
},
6160
};
6261

62+
/**
63+
* Set the Element Call URL in the dev tool settings using `window.mxSettingsStore` via `page.evaluate`.
64+
* @param page
65+
*/
66+
async function setDevToolElementCallDevUrl(page: Page): Promise<void> {
67+
await page.evaluate(() => {
68+
window.mxSettingsStore.setValue(
69+
"Developer.elementCallUrl",
70+
null,
71+
"device",
72+
"https://localhost:3000/room",
73+
);
74+
});
75+
}
76+
6377
export const widgetTest = test.extend<MyFixtures>({
6478
asWidget: async ({ browser, context }, pUse) => {
6579
await context.route(`http://localhost:8081/config.json*`, async (route) => {
@@ -88,6 +102,7 @@ export const widgetTest = test.extend<MyFixtures>({
88102
await expect(
89103
ewPage1.getByRole("heading", { name: `Welcome ${userA}` }),
90104
).toBeVisible();
105+
await setDevToolElementCallDevUrl(ewPage1);
91106

92107
const brooksClientHandle = await ewPage1.evaluateHandle(() =>
93108
window.mxMatrixClientPeg.get(),
@@ -115,6 +130,7 @@ export const widgetTest = test.extend<MyFixtures>({
115130
await expect(
116131
ewPage2.getByRole("heading", { name: `Welcome ${userB}` }),
117132
).toBeVisible();
133+
await setDevToolElementCallDevUrl(ewPage2);
118134

119135
const whistlerClientHandle = await ewPage2.evaluateHandle(() =>
120136
window.mxMatrixClientPeg.get(),

playwright/global.d.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,20 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
55
Please see LICENSE in the repository root for full details.
66
*/
77

8-
import type * as Matrix from "matrix-js-sdk/src";
8+
import type * as Matrix from "matrix-js-sdk";
99

1010
declare global {
1111
interface Window {
1212
mxMatrixClientPeg: {
1313
get(): Matrix.MatrixClient;
1414
};
15+
mxSettingsStore: {
16+
setValue: (
17+
settingKey: string,
18+
room: string | null,
19+
level: string,
20+
setting: string,
21+
) => void;
22+
};
1523
}
1624
}

0 commit comments

Comments
 (0)