Skip to content

Commit

Permalink
🧪 improve setting e2e test stability (#3513)
Browse files Browse the repository at this point in the history
  • Loading branch information
MatissJanis authored Sep 27, 2024
1 parent 686ce5b commit 666b787
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 3 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions packages/desktop-client/playwright.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/src/style/theme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/3513.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Maintenance
authors: [MatissJanis]
---

e2e: improve settings test stability.

0 comments on commit 666b787

Please sign in to comment.