Skip to content
This repository was archived by the owner on Oct 22, 2024. It is now read-only.

Commit 25b90e2

Browse files
committed
Add e2e test
1 parent 6171df4 commit 25b90e2

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

playwright/e2e/pinned-messages/index.ts

+8
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ export class Helpers {
9191
await this.app.viewRoomByName(typeof room === "string" ? room : room.name);
9292
}
9393

94+
/**
95+
* Get the timeline tile for the given message
96+
* @param message
97+
*/
98+
getEventTile(message: string) {
99+
return this.page.locator(".mx_EventTile", { hasText: message });
100+
}
101+
94102
/**
95103
* Pin the given message from the quick actions
96104
* @param message

playwright/e2e/pinned-messages/pinned-messages.spec.ts

+16
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,22 @@ test.describe("Pinned messages", () => {
1818
await util.assertEmptyPinnedMessagesList();
1919
});
2020

21+
test("should pin one message and to have the pinned message badge in the timeline", async ({
22+
page,
23+
app,
24+
room1,
25+
util,
26+
}) => {
27+
await util.goTo(room1);
28+
await util.receiveMessages(room1, ["Msg1"]);
29+
await util.pinMessages(["Msg1"]);
30+
31+
const tile = util.getEventTile("Msg1");
32+
await expect(tile).toMatchScreenshot("pinned-message-Msg1.png", {
33+
mask: [tile.locator(".mx_MessageTimestamp")],
34+
});
35+
});
36+
2137
test("should pin messages and show them in the room info panel", async ({ page, app, room1, util }) => {
2238
await util.goTo(room1);
2339
await util.receiveMessages(room1, ["Msg1", "Msg2", "Msg3", "Msg4"]);
Loading

0 commit comments

Comments
 (0)