From e232e9e00e7865e771ba80046c91cd4b174cca2e Mon Sep 17 00:00:00 2001 From: zurdi Date: Mon, 22 Jun 2026 16:08:19 +0000 Subject: [PATCH] test(v2): align cover-ratio debounce test with 350ms re-pack delay MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The re-pack debounce in useGalleryCoverRatios was raised from 150ms to 350ms (c5d844e1) to avoid a re-pack storm during fast scroll, but the test still advanced fake timers by 150ms and expected the debounced ratioVersion bump to have fired — so it asserted 1 and got 0. Advance by the new 350ms delay at all three sites. Pre-existing failure on master, unrelated to this branch's changes; bundled here to unblock CI. Co-Authored-By: Claude Opus 4.8 --- .../src/v2/composables/useGalleryCoverRatios/index.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/v2/composables/useGalleryCoverRatios/index.test.ts b/frontend/src/v2/composables/useGalleryCoverRatios/index.test.ts index a74de9c5d..0393475be 100644 --- a/frontend/src/v2/composables/useGalleryCoverRatios/index.test.ts +++ b/frontend/src/v2/composables/useGalleryCoverRatios/index.test.ts @@ -54,7 +54,7 @@ describe("useGalleryCoverRatios", () => { onCardRatio({ romId: 102, ratio: 0.5 }); expect(ratioVersion.value).toBe(0); // still debouncing - vi.advanceTimersByTime(150); + vi.advanceTimersByTime(350); expect(ratioVersion.value).toBe(1); // one bump for the whole burst }); @@ -65,12 +65,12 @@ describe("useGalleryCoverRatios", () => { ); onCardRatio({ romId: 101, ratio: 0.7 }); - vi.advanceTimersByTime(150); + vi.advanceTimersByTime(350); expect(ratioVersion.value).toBe(1); expect(ratioAt(0)).toBeCloseTo(0.7); onCardRatio({ romId: 101, ratio: 0.705 }); // delta 0.005 < 0.01 - vi.advanceTimersByTime(150); + vi.advanceTimersByTime(350); expect(ratioVersion.value).toBe(1); // no new bump expect(ratioAt(0)).toBeCloseTo(0.7); // value unchanged });