Skip to content

Commit

Permalink
Iterate
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Telatynski <[email protected]>
  • Loading branch information
t3chguy committed Jan 15, 2025
1 parent 2b4f66a commit b4805d0
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions playwright/e2e/messages/messages.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ async function editMessage(page: Page, message: Locator, newMsg: string): Promis
await editComposer.press("Enter");
}

const screenshotOptions = (page: Page) => ({
mask: [page.locator(".mx_MessageTimestamp")],
const screenshotOptions = (page?: Page) => ({
mask: page ? [page.locator(".mx_MessageTimestamp")] : undefined,
// Hide the jump to bottom button in the timeline to avoid flakiness
css: `
.mx_JumpToBottomButton {
Expand Down Expand Up @@ -100,10 +100,7 @@ test.describe("Message rendering", () => {
await page.goto(`#/room/${room.roomId}`);

const msgTile = await sendMessage(page, "/me lays an egg");
await expect(msgTile).toMatchScreenshot(
`emote-ltr-${direction}displayname.png`,
screenshotOptions(page),
);
await expect(msgTile).toMatchScreenshot(`emote-ltr-${direction}displayname.png`, screenshotOptions());
});

test("should render an LTR rich text emote", async ({ page, user, app, room }) => {
Expand All @@ -112,7 +109,7 @@ test.describe("Message rendering", () => {
const msgTile = await sendMessage(page, "/me lays a *free range* egg");
await expect(msgTile).toMatchScreenshot(
`emote-rich-ltr-${direction}displayname.png`,
screenshotOptions(page),
screenshotOptions(),
);
});

Expand Down Expand Up @@ -160,10 +157,7 @@ test.describe("Message rendering", () => {
await page.goto(`#/room/${room.roomId}`);

const msgTile = await sendMessage(page, "/me يضع بيضة");
await expect(msgTile).toMatchScreenshot(
`emote-rtl-${direction}displayname.png`,
screenshotOptions(page),
);
await expect(msgTile).toMatchScreenshot(`emote-rtl-${direction}displayname.png`, screenshotOptions());
});

test("should render a richtext RTL emote", async ({ page, user, app, room }) => {
Expand All @@ -172,7 +166,7 @@ test.describe("Message rendering", () => {
const msgTile = await sendMessage(page, "/me أضع بيضة *حرة النطاق*");
await expect(msgTile).toMatchScreenshot(
`emote-rich-rtl-${direction}displayname.png`,
screenshotOptions(page),
screenshotOptions(),
);
});

Expand Down

0 comments on commit b4805d0

Please sign in to comment.