1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-21 09:38:01 +02:00
joplin/packages/app-desktop/integration-tests/util/setDarkMode.ts
Henry Heino a616dc3cd2
Desktop: Fix errors found by automated accessibility testing (#11246)
Co-authored-by: Laurent Cozic <laurent22@users.noreply.github.com>
2024-11-09 12:50:06 +00:00

10 lines
286 B
TypeScript

import { ElectronApplication } from '@playwright/test';
const setDarkMode = (app: ElectronApplication, darkMode: boolean) => {
return app.evaluate(({ nativeTheme }, darkMode) => {
nativeTheme.themeSource = darkMode ? 'dark' : 'light';
}, darkMode);
};
export default setDarkMode;