diff --git a/playwright/e2e/modules/custom-component.spec.ts b/playwright/e2e/modules/custom-component.spec.ts index 0a48c800c7..7d91816231 100644 --- a/playwright/e2e/modules/custom-component.spec.ts +++ b/playwright/e2e/modules/custom-component.spec.ts @@ -28,11 +28,17 @@ test.describe("Custom Component Module", () => { await app.client.sendMessage(room.roomId, "Simple message"); await expect(await page.getByText("Simple message")).toMatchScreenshot("custom-component-tile.png"); }); - test("should fall through if one module does not render a component", { tag: "@screenshot" }, async ({ page, room, app }) => { - await app.viewRoomById(room.roomId); - await app.client.sendMessage(room.roomId, "Fall through here"); - await expect(await page.getByText("Fall through here")).toMatchScreenshot("custom-component-tile-fall-through.png"); - }); + test( + "should fall through if one module does not render a component", + { tag: "@screenshot" }, + async ({ page, room, app }) => { + await app.viewRoomById(room.roomId); + await app.client.sendMessage(room.roomId, "Fall through here"); + await expect(await page.getByText("Fall through here")).toMatchScreenshot( + "custom-component-tile-fall-through.png", + ); + }, + ); test( "should render the original content of a textual event conditionally", { tag: "@screenshot" }, diff --git a/playwright/sample-files/custom-component-module.js b/playwright/sample-files/custom-component-module.js index 62cfe883da..0b547a69ab 100644 --- a/playwright/sample-files/custom-component-module.js +++ b/playwright/sample-files/custom-component-module.js @@ -13,8 +13,7 @@ export default class CustomComponentModule { const body = props.mxEvent.getContent().body; if (body === "Do not replace me") { return originalComponent(); - } - else if (body === "Fall through here"){ + } else if (body === "Fall through here") { return null; } return `Custom text for ${body}`;