mirror of
https://github.com/element-hq/element-web.git
synced 2025-12-28 07:14:20 +00:00
test(e2e): add tests to ensure that font and emoji stay unchanged
This commit is contained in:
parent
e90c50e0ab
commit
fa8cf9f474
@ -56,4 +56,35 @@ test.describe("Appearance user settings tab", () => {
|
||||
// Assert that the font-family value was removed
|
||||
await expect(page.locator("body")).toHaveCSS("font-family", '""');
|
||||
});
|
||||
|
||||
test(
|
||||
"should keep same font and emoji when switching theme",
|
||||
{ tag: "@screenshot" },
|
||||
async ({ page, app, user, util }) => {
|
||||
const roomId = await util.createAndDisplayRoom();
|
||||
await app.client.sendMessage(roomId, { body: "Message with 🦡", msgtype: "m.text" });
|
||||
|
||||
await app.settings.openUserSettings("Appearance");
|
||||
const tab = page.getByTestId("mx_AppearanceUserSettingsTab");
|
||||
await tab.getByRole("button", { name: "Show advanced" }).click();
|
||||
await tab.getByRole("switch", { name: "Use bundled emoji font" }).click();
|
||||
await tab.getByRole("switch", { name: "Use a system font" }).click();
|
||||
|
||||
await app.closeDialog();
|
||||
await expect(page).toMatchScreenshot("window-before-switch.png", {
|
||||
mask: [page.locator(".mx_MessageTimestamp")],
|
||||
});
|
||||
|
||||
// Switch to dark theme
|
||||
await app.settings.openUserSettings("Appearance");
|
||||
await util.getMatchSystemThemeSwitch().click();
|
||||
await util.getDarkTheme().click();
|
||||
|
||||
await app.closeDialog();
|
||||
// Font and emoji should remain the same after theme switch
|
||||
await expect(page).toMatchScreenshot("window-after-switch.png", {
|
||||
mask: [page.locator(".mx_MessageTimestamp")],
|
||||
});
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
@ -150,9 +150,10 @@ class Helpers {
|
||||
/**
|
||||
* Create and display a room named Test Room
|
||||
*/
|
||||
async createAndDisplayRoom() {
|
||||
await this.app.client.createRoom({ name: "Test Room" });
|
||||
async createAndDisplayRoom(): Promise<string> {
|
||||
const roomId = await this.app.client.createRoom({ name: "Test Room" });
|
||||
await this.app.viewRoomByName("Test Room");
|
||||
return roomId;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 74 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 74 KiB |
Loading…
Reference in New Issue
Block a user