This commit is contained in:
Half-Shot 2025-05-20 14:27:27 +01:00
parent afab6c29dc
commit 1ed3f205f3
3 changed files with 19 additions and 14 deletions

View File

@ -19,18 +19,24 @@ test.describe("Custom Component Module", () => {
await use(page);
},
room: async ({ page, app, user, bot }, use) => {
const roomId = await app.client.createRoom({ name: 'TestRoom' });
const roomId = await app.client.createRoom({ name: "TestRoom" });
await use({ roomId });
},
});
test("should replace the render method of a textual event", { tag: "@screenshot" }, async ({ page, room, app }) => {
test("should replace the render method of a textual event", { tag: "@screenshot" }, async ({ page, room, app }) => {
await app.viewRoomById(room.roomId);
await app.client.sendMessage(room.roomId, 'Simple message');
await app.client.sendMessage(room.roomId, "Simple message");
await expect(await page.getByText("Simple message")).toMatchScreenshot("custom-component-tile.png");
});
test("should render the original content of a textual event conditionally", { tag: "@screenshot" }, async ({ page, room, app }) => {
await app.viewRoomById(room.roomId);
await app.client.sendMessage(room.roomId, 'Do not replace me');
await expect(await page.getByText("Do not replace me")).toMatchScreenshot("custom-component-tile-original.png");
});
test(
"should render the original content of a textual event conditionally",
{ tag: "@screenshot" },
async ({ page, room, app }) => {
await app.viewRoomById(room.roomId);
await app.client.sendMessage(room.roomId, "Do not replace me");
await expect(await page.getByText("Do not replace me")).toMatchScreenshot(
"custom-component-tile-original.png",
);
},
);
});

View File

@ -15,9 +15,7 @@ export default class CustomComponentModule {
return originalComponent();
}
return `Custom text for ${body}`;
})
}
async load() {
});
}
async load() {}
}

View File

@ -3765,15 +3765,16 @@
classnames "^2.5.1"
vaul "^1.0.0"
"@vector-im/matrix-wysiwyg-wasm@link:../../Library/Caches/Yarn/v6/npm-@vector-im-matrix-wysiwyg-2.38.3-cc54d8b3e9472bcd8e622126ba364ee31952cd8a-integrity/node_modules/bindings/wysiwyg-wasm":
"@vector-im/matrix-wysiwyg-wasm@link:../../../.cache/yarn/v6/npm-@vector-im-matrix-wysiwyg-2.38.3-cc54d8b3e9472bcd8e622126ba364ee31952cd8a-integrity/node_modules/bindings/wysiwyg-wasm":
version "0.0.0"
uid ""
"@vector-im/matrix-wysiwyg@2.38.3":
version "2.38.3"
resolved "https://registry.yarnpkg.com/@vector-im/matrix-wysiwyg/-/matrix-wysiwyg-2.38.3.tgz#cc54d8b3e9472bcd8e622126ba364ee31952cd8a"
integrity sha512-fqo8P55Vc/t0vxpFar9RDJN5gKEjJmzrLo+O4piDbFda6VrRoqrWAtiu0Au0g6B4hRDPKIuFupk8v9Ja7q8Hvg==
dependencies:
"@vector-im/matrix-wysiwyg-wasm" "link:../../Library/Caches/Yarn/v6/npm-@vector-im-matrix-wysiwyg-2.38.3-cc54d8b3e9472bcd8e622126ba364ee31952cd8a-integrity/node_modules/bindings/wysiwyg-wasm"
"@vector-im/matrix-wysiwyg-wasm" "link:../../../.cache/yarn/v6/npm-@vector-im-matrix-wysiwyg-2.38.3-cc54d8b3e9472bcd8e622126ba364ee31952cd8a-integrity/node_modules/bindings/wysiwyg-wasm"
"@webassemblyjs/ast@1.14.1", "@webassemblyjs/ast@^1.14.1":
version "1.14.1"