Skip to content

Commit 677ac5b

Browse files
committed
Fix playwright test
1 parent a2d84fb commit 677ac5b

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

playwright/e2e/left-panel/room-list-panel/room-list-filter-sort.spec.ts

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

8-
import { Visibility } from "matrix-js-sdk/src/matrix";
8+
import { type Visibility } from "matrix-js-sdk/src/matrix";
9+
import { type Locator, type Page } from "@playwright/test";
10+
911
import { expect, test } from "../../../element-web-test";
1012
import { SettingLevel } from "../../../../src/settings/SettingLevel";
11-
import { type Locator, type Page } from "@playwright/test";
1213

1314
test.describe("Room list filters and sort", () => {
1415
test.use({
@@ -43,7 +44,7 @@ test.describe("Room list filters and sort", () => {
4344

4445
test("Tombstoned rooms are not shown even when they receive updates", async ({ page, app, bot }) => {
4546
// This bug shows up with this setting turned on
46-
app.settings.setValue("Spaces.allRoomsInHome", null, SettingLevel.DEVICE, true);
47+
await app.settings.setValue("Spaces.allRoomsInHome", null, SettingLevel.DEVICE, true);
4748

4849
/*
4950
We will first create a room named 'Old Room' and will invite the bot user to this room.
@@ -60,7 +61,7 @@ test.describe("Room list filters and sort", () => {
6061
*/
6162
const roomListView = getRoomList(page);
6263
const oldRoomTile = roomListView.getByRole("gridcell", { name: "Open room Old Room" });
63-
expect(oldRoomTile).toBeVisible();
64+
await expect(oldRoomTile).toBeVisible();
6465

6566
/*
6667
Now let's tombstone 'Old Room'.
@@ -74,7 +75,7 @@ test.describe("Room list filters and sort", () => {
7475
room_id: oldRoomId,
7576
},
7677
},
77-
visibility: Visibility.Public,
78+
visibility: "public" as Visibility,
7879
});
7980

8081
/*
@@ -89,15 +90,15 @@ test.describe("Room list filters and sort", () => {
8990
await app.client.joinRoom(newRoomId);
9091

9192
// We expect 'Old Room' to be hidden from the room list.
92-
expect(oldRoomTile).not.toBeVisible();
93+
await expect(oldRoomTile).not.toBeVisible();
9394

9495
/*
9596
Let's say some user in the 'Old Room' changes their display name.
9697
This will send events to the all the rooms including 'Old Room'.
9798
Nevertheless, the replaced room should not be shown in the room list.
9899
*/
99100
await bot.setDisplayName("MyNewName");
100-
expect(oldRoomTile).not.toBeVisible();
101+
await expect(oldRoomTile).not.toBeVisible();
101102
});
102103

103104
test.describe("Scroll behaviour", () => {

0 commit comments

Comments
 (0)