Skip to content

Commit f207371

Browse files
committed
test(e2e): fix room list test
1 parent 592e409 commit f207371

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

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

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ test.describe("Room list", () => {
4343
await expect(roomListView.getByRole("gridcell", { name: "Open room room29" })).toBeVisible();
4444
await expect(roomListView).toMatchScreenshot("room-list.png");
4545

46-
await roomListView.hover();
46+
// Put focus on the room list
47+
await roomListView.getByRole("gridcell", { name: "Open room room29" }).click();
4748
// Scroll to the end of the room list
4849
await page.mouse.wheel(0, 1000);
4950
await expect(roomListView.getByRole("gridcell", { name: "Open room room0" })).toBeVisible();
@@ -105,13 +106,10 @@ test.describe("Room list", () => {
105106
// It should make the room muted
106107
await page.getByRole("menuitem", { name: "Mute room" }).click();
107108

108-
// Remove hover on the room list item
109-
await roomListView.hover();
110-
111-
// Scroll to the bottom of the list
112-
await page.getByRole("grid", { name: "Room list" }).evaluate((e) => {
113-
e.scrollTop = e.scrollHeight;
114-
});
109+
// Put focus on the room list
110+
await roomListView.getByRole("gridcell", { name: "Open room room28" }).click();
111+
// Scroll to the end of the room list
112+
await page.mouse.wheel(0, 1000);
115113

116114
// The room decoration should have the muted icon
117115
await expect(roomItem.getByTestId("notification-decoration")).toBeVisible();
@@ -129,7 +127,8 @@ test.describe("Room list", () => {
129127

130128
test("should scroll to the current room", async ({ page, app, user }) => {
131129
const roomListView = getRoomList(page);
132-
await roomListView.hover();
130+
// Put focus on the room list
131+
await roomListView.getByRole("gridcell", { name: "Open room room29" }).click();
133132
// Scroll to the end of the room list
134133
await page.mouse.wheel(0, 1000);
135134

0 commit comments

Comments
 (0)