Skip to content

Commit 6cac781

Browse files
committed
test(e2e): add more tests for empty room list for new primary filters
1 parent 7690fad commit 6cac781

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed

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

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -316,15 +316,25 @@ test.describe("Room list filters and sort", () => {
316316
},
317317
);
318318

319-
test("should render the placeholder for unread filter", { tag: "@screenshot" }, async ({ page, app, user }) => {
320-
const primaryFilters = getPrimaryFilters(page);
321-
await primaryFilters.getByRole("option", { name: "Unread" }).click();
319+
[
320+
{ filter: "Unreads", action: "Show all chats" },
321+
{ filter: "Mentions", action: "See all activity" },
322+
{ filter: "Invites", action: "See all activity" },
323+
].forEach(({ filter, action }) => {
324+
test(
325+
`should render the placeholder for ${filter} filter`,
326+
{ tag: "@screenshot" },
327+
async ({ page, app, user }) => {
328+
const primaryFilters = getPrimaryFilters(page);
329+
await primaryFilters.getByRole("option", { name: filter }).click();
322330

323-
const emptyRoomList = getEmptyRoomList(page);
324-
await expect(emptyRoomList).toMatchScreenshot("unread-empty-room-list.png");
331+
const emptyRoomList = getEmptyRoomList(page);
332+
await expect(emptyRoomList).toMatchScreenshot(`${filter}-empty-room-list.png`);
325333

326-
await emptyRoomList.getByRole("button", { name: "show all chats" }).click();
327-
await expect(primaryFilters.getByRole("option", { name: "Unread" })).not.toBeChecked();
334+
await emptyRoomList.getByRole("button", { name: action }).click();
335+
await expect(primaryFilters.getByRole("option", { name: filter })).not.toBeChecked();
336+
},
337+
);
328338
});
329339

330340
["People", "Rooms", "Favourite"].forEach((filter) => {

0 commit comments

Comments
 (0)