Make apps/web/playwright comply with strict mode (#34403)

* Make apps/web/playwright comply with strict mode

Otherwise it sometimes fails to compile matrix-js-sdk as strict mode & noImplicitAny both impact how overloads are asserted

* Iterate
This commit is contained in:
Michael Telatynski
2026-07-30 09:07:03 +00:00
committed by GitHub
parent 4a18eac927
commit 42253a7ae5
84 changed files with 413 additions and 388 deletions
@@ -75,7 +75,7 @@ test.describe("Widget Events", () => {
}) => {
const roomId = await app.client.createRoom({
name: ROOM_NAME,
invite: [bot.credentials.userId],
invite: [bot.credentials!.userId],
});
// setup widget via state event
@@ -30,7 +30,7 @@ test.describe("Jitsi Calls", () => {
test("should be able to pop out a jitsi widget", async ({ page, app, bot, bot2, context }) => {
const roomId = await app.client.createRoom({
name: ROOM_NAME,
invite: [bot.credentials.userId, bot2.credentials.userId],
invite: [bot.credentials!.userId, bot2.credentials!.userId],
});
await bot.joinRoom(roomId);
@@ -76,19 +76,19 @@ test.describe("Widget Layout", () => {
test("manually resize the height of the top container layout", async ({ page }) => {
const iframe = page.locator('iframe[title="widget"]');
expect((await iframe.boundingBox()).height).toBeLessThan(250);
expect((await iframe.boundingBox())!.height).toBeLessThan(250);
await page.locator(".mx_AppsDrawer_resizer_container_handle").hover();
await page.mouse.down();
await page.mouse.move(0, 550);
await page.mouse.up();
expect((await iframe.boundingBox()).height).toBeGreaterThan(400);
expect((await iframe.boundingBox())!.height).toBeGreaterThan(400);
});
test("programmatically resize the height of the top container layout", async ({ page, app }) => {
const iframe = page.locator('iframe[title="widget"]');
expect((await iframe.boundingBox()).height).toBeLessThan(250);
expect((await iframe.boundingBox())!.height).toBeLessThan(250);
await app.client.sendStateEvent(
roomId,
@@ -106,6 +106,6 @@ test.describe("Widget Layout", () => {
"",
);
await expect.poll(async () => (await iframe.boundingBox()).height).toBeGreaterThan(400);
await expect.poll(async () => (await iframe.boundingBox())!.height).toBeGreaterThan(400);
});
});
@@ -56,7 +56,7 @@ async function waitForRoomWidget(client: Client, widgetId: string, roomId: strin
}
}
const room = matrixClient.getRoom(roomId);
const room = matrixClient.getRoom(roomId)!;
const startingWidgetEvents = room.currentState.getStateEvents("im.vector.modular.widgets");
if (eventsInIntendedState(startingWidgetEvents)) {
@@ -97,14 +97,14 @@ test.describe("Widget PIP", () => {
test(`should be closed on ${userRemove}`, async ({ page, app, bot, user }) => {
const roomId = await app.client.createRoom({
name: ROOM_NAME,
invite: [bot.credentials.userId],
invite: [bot.credentials!.userId],
});
// sets bot to Admin and user to Moderator
await app.client.sendStateEvent(roomId, "m.room.power_levels", {
users: {
[user.userId]: 50,
[bot.credentials.userId]: 100,
[bot.credentials!.userId]: 100,
},
});