سامانه صدور فاکتور و حسابداری

test(theme): await settled light-button luminance without weakening contrast gate

davoodmehraban89 committed Oct 14, 2026 at 09:02 UTC dfdb8221404b440e1bc9d8a148786f3a386801e9
1 file changed +3
scripts/phase0-dark-theme-contrast.spec.js
+3
@@ -72,6 +72,9 @@ test('F0-06 light mode remains legible after switching out of dark mode',async({
72 // Buttons animate their background for 200ms; assert steady-state contrast,
73 // not an intermediate frame during CSS transition.
74 await expect.poll(async()=>(await sample(page)).button.contrast,{timeout:3000}).toBeGreaterThanOrEqual(4.5);
75 + // The same transition can already pass contrast before its light background
76 + // reaches the target luminance; wait for both steady-state requirements.
77 + await expect.poll(async()=>(await sample(page)).button.backgroundLuminance,{timeout:3000}).toBeGreaterThan(0.5);
78 const s=await sample(page);
79 expect(s.rootDark).toBe(false);
80 expect(s.accordion.contrast).toBeGreaterThanOrEqual(4.5);