From f8152f4b73d3309c90f2c3ae24d99201ed5ec02b Mon Sep 17 00:00:00 2001 From: Dustin Brett Date: Sat, 19 Oct 2024 08:39:08 -0700 Subject: [PATCH] Wallpaper test tweaks --- components/system/Desktop/Wallpapers/useWallpaper.ts | 4 ++-- e2e/components/system/Wallpaper.spec.ts | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/components/system/Desktop/Wallpapers/useWallpaper.ts b/components/system/Desktop/Wallpapers/useWallpaper.ts index 7c428212..e6d7e47b 100644 --- a/components/system/Desktop/Wallpapers/useWallpaper.ts +++ b/components/system/Desktop/Wallpapers/useWallpaper.ts @@ -85,7 +85,7 @@ const useWallpaper = ( ); const loadWallpaper = useCallback( async (keepCanvas?: boolean) => { - if (!desktopRef.current) return; + if (!desktopRef.current || window.DEBUG_DISABLE_WALLPAPER) return; let config: WallpaperConfig | undefined; const { matches: prefersReducedMotion } = window.matchMedia( @@ -487,7 +487,7 @@ const useWallpaper = ( ]); useEffect(() => { - if (sessionLoaded && !window.DEBUG_DISABLE_WALLPAPER) { + if (sessionLoaded) { if (wallpaperTimerRef.current) { window.clearTimeout(wallpaperTimerRef.current); } diff --git a/e2e/components/system/Wallpaper.spec.ts b/e2e/components/system/Wallpaper.spec.ts index bb928474..fdba0894 100644 --- a/e2e/components/system/Wallpaper.spec.ts +++ b/e2e/components/system/Wallpaper.spec.ts @@ -10,6 +10,7 @@ import { contextMenuIsVisible, desktopIsVisible, didCaptureConsoleLogs, + disableWallpaper, fileExplorerEntriesAreVisible, loadAppWithCanvas, mockPictureSlideshowRequest, @@ -46,6 +47,7 @@ test("can change background", async ({ headless, browserName, page }) => { }); test.describe("can set backgound", () => { + test.beforeEach(disableWallpaper); test.beforeEach(async ({ page }) => page.goto("/?url=/System/Icons/48x48")); test.beforeEach(windowsAreVisible); test.beforeEach(fileExplorerEntriesAreVisible);