From b0e973ed0281713633645a2604f831d1aa3a07d3 Mon Sep 17 00:00:00 2001 From: rdlabo Date: Fri, 20 Nov 2026 10:03:44 +0900 Subject: [PATCH] Require the delayed cover reply in the hidden projection test --- tests/projection/web.spec.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/projection/web.spec.ts b/tests/projection/web.spec.ts index b7212fc..c4d3156 100644 --- a/tests/projection/web.spec.ts +++ b/tests/projection/web.spec.ts @@ -957,11 +957,15 @@ test('hidden notification invalidates delayed cover and updates cannot resurrect const w = window as any; w.holdCover = true; w.eventListeners.transitionStarted({ id: 'counter' }); + }); + expect(await page.evaluate(() => (window as any).coverReplies.length)).toBe(1); + await page.evaluate(() => { + const w = window as any; w.eventListeners.hidden({ id: 'counter' }); - w.coverReplies.splice(0).forEach((resolve: (value: { shown: boolean }) => void) => resolve({ shown: true })); + w.coverReplies.shift()({ shown: true }); w.eventListeners.setColors({ id: 'counter' }); }); - await page.waitForTimeout(100); + await page.evaluate(() => new Promise((resolve) => requestAnimationFrame(() => requestAnimationFrame(() => resolve())))); await expect(page.locator('#source')).not.toHaveAttribute('data-native-ui-snapshot-visible'); expect(await page.evaluate(() => (window as any).calls.filter((call: any) => call.action === 'prepare').length)).toBe(1); await page.evaluate(() => (window as any).eventListeners.shown({ id: 'counter' }));