mirror of
https://github.com/vector-im/element-web.git
synced 2026-05-07 05:06:38 +02:00
lint
This commit is contained in:
parent
757e4e1395
commit
ce428b5e2d
@ -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" },
|
||||
|
||||
@ -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}`;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user