🧪 improve setting e2e test stability (#3513)
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 80 KiB |
@@ -18,7 +18,7 @@ expect.extend({
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Check lightmode
|
// Check lightmode
|
||||||
await locator.evaluate(() => window.Actual.setTheme('light'));
|
await locator.evaluate(() => window.Actual.setTheme('auto'));
|
||||||
const lightmode = await expect(locator).toHaveScreenshot(config);
|
const lightmode = await expect(locator).toHaveScreenshot(config);
|
||||||
|
|
||||||
if (lightmode && !lightmode.pass) {
|
if (lightmode && !lightmode.pass) {
|
||||||
@@ -44,7 +44,7 @@ expect.extend({
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Switch back to lightmode
|
// Switch back to lightmode
|
||||||
await locator.evaluate(() => window.Actual.setTheme('light'));
|
await locator.evaluate(() => window.Actual.setTheme('auto'));
|
||||||
return {
|
return {
|
||||||
message: () => 'pass',
|
message: () => 'pass',
|
||||||
pass: true,
|
pass: true,
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export const darkThemeOptions = Object.entries({
|
|||||||
}).map(([key, { name }]) => [key, name] as [DarkTheme, string]);
|
}).map(([key, { name }]) => [key, name] as [DarkTheme, string]);
|
||||||
|
|
||||||
export function useTheme() {
|
export function useTheme() {
|
||||||
const [theme = 'light', setThemePref] = useGlobalPref('theme');
|
const [theme = 'auto', setThemePref] = useGlobalPref('theme');
|
||||||
return [theme, setThemePref] as const;
|
return [theme, setThemePref] as const;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
6
upcoming-release-notes/3513.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
category: Maintenance
|
||||||
|
authors: [MatissJanis]
|
||||||
|
---
|
||||||
|
|
||||||
|
e2e: improve settings test stability.
|
||||||