Wallpaper test tweaks

This commit is contained in:
Dustin Brett 2024-10-19 08:39:08 -07:00
parent 6bb612d32d
commit f8152f4b73
2 changed files with 4 additions and 2 deletions

View File

@ -85,7 +85,7 @@ const useWallpaper = (
); );
const loadWallpaper = useCallback( const loadWallpaper = useCallback(
async (keepCanvas?: boolean) => { async (keepCanvas?: boolean) => {
if (!desktopRef.current) return; if (!desktopRef.current || window.DEBUG_DISABLE_WALLPAPER) return;
let config: WallpaperConfig | undefined; let config: WallpaperConfig | undefined;
const { matches: prefersReducedMotion } = window.matchMedia( const { matches: prefersReducedMotion } = window.matchMedia(
@ -487,7 +487,7 @@ const useWallpaper = (
]); ]);
useEffect(() => { useEffect(() => {
if (sessionLoaded && !window.DEBUG_DISABLE_WALLPAPER) { if (sessionLoaded) {
if (wallpaperTimerRef.current) { if (wallpaperTimerRef.current) {
window.clearTimeout(wallpaperTimerRef.current); window.clearTimeout(wallpaperTimerRef.current);
} }

View File

@ -10,6 +10,7 @@ import {
contextMenuIsVisible, contextMenuIsVisible,
desktopIsVisible, desktopIsVisible,
didCaptureConsoleLogs, didCaptureConsoleLogs,
disableWallpaper,
fileExplorerEntriesAreVisible, fileExplorerEntriesAreVisible,
loadAppWithCanvas, loadAppWithCanvas,
mockPictureSlideshowRequest, mockPictureSlideshowRequest,
@ -46,6 +47,7 @@ test("can change background", async ({ headless, browserName, page }) => {
}); });
test.describe("can set backgound", () => { test.describe("can set backgound", () => {
test.beforeEach(disableWallpaper);
test.beforeEach(async ({ page }) => page.goto("/?url=/System/Icons/48x48")); test.beforeEach(async ({ page }) => page.goto("/?url=/System/Icons/48x48"));
test.beforeEach(windowsAreVisible); test.beforeEach(windowsAreVisible);
test.beforeEach(fileExplorerEntriesAreVisible); test.beforeEach(fileExplorerEntriesAreVisible);