Make Playwright screenshot test resilient to DST changes (#31089)

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2025-10-27 12:17:40 +00:00 committed by GitHub
parent 5e87f20cd8
commit e528fefd4c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View File

@ -31,8 +31,13 @@ test.describe("Preferences user settings tab", () => {
// Assert that the top heading is rendered
await expect(tab.getByRole("heading", { name: "Preferences" })).toBeVisible();
await expect(tab).toMatchScreenshot("Preferences-user-settings-tab-should-be-rendered-properly-1.png", {
// masked due to daylight saving time
// masked with fixed-width due to daylight saving time making the text content vary
mask: [tab.locator("#mx_dropdownUserTimezone_value")],
css: `
#mx_dropdownUserTimezone_value {
width: 200px;
}
`,
});
});

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 KiB

After

Width:  |  Height:  |  Size: 260 KiB