🧪 improve setting e2e test stability (#3513)

This commit is contained in:
Matiss Janis Aboltins
2024-09-27 08:03:25 +01:00
committed by GitHub
parent 686ce5b504
commit 666b7870b7
8 changed files with 9 additions and 3 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 80 KiB

View File

@@ -18,7 +18,7 @@ expect.extend({
};
// Check lightmode
await locator.evaluate(() => window.Actual.setTheme('light'));
await locator.evaluate(() => window.Actual.setTheme('auto'));
const lightmode = await expect(locator).toHaveScreenshot(config);
if (lightmode && !lightmode.pass) {
@@ -44,7 +44,7 @@ expect.extend({
}
// Switch back to lightmode
await locator.evaluate(() => window.Actual.setTheme('light'));
await locator.evaluate(() => window.Actual.setTheme('auto'));
return {
message: () => 'pass',
pass: true,

View File

@@ -31,7 +31,7 @@ export const darkThemeOptions = Object.entries({
}).map(([key, { name }]) => [key, name] as [DarkTheme, string]);
export function useTheme() {
const [theme = 'light', setThemePref] = useGlobalPref('theme');
const [theme = 'auto', setThemePref] = useGlobalPref('theme');
return [theme, setThemePref] as const;
}

View File

@@ -0,0 +1,6 @@
---
category: Maintenance
authors: [MatissJanis]
---
e2e: improve settings test stability.