From b1801cb92ab3183910e0f3a4dfd440c5f9e12f72 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Sun, 19 Jul 2026 19:34:02 +0000 Subject: [PATCH] tests: Fix test failing from other tests running. --- .../forms/__tests__/LiveGroupFilter.test.jsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/forms/__tests__/LiveGroupFilter.test.jsx b/frontend/src/components/forms/__tests__/LiveGroupFilter.test.jsx index b96b6b4b..758bcd1e 100644 --- a/frontend/src/components/forms/__tests__/LiveGroupFilter.test.jsx +++ b/frontend/src/components/forms/__tests__/LiveGroupFilter.test.jsx @@ -102,7 +102,19 @@ vi.mock('../Logo.jsx', () => ({ // ── Utility mocks ───────────────────────────────────────────────────────────── vi.mock('../../../utils/forms/LiveGroupFilterUtils.js', () => ({ - abortTimers: vi.fn(), + // Real cleanup so debounced regex-preview timers do not leak across tests. + abortTimers: (timerRef, abortRef) => { + Object.values(timerRef.current).forEach((t) => clearTimeout(t)); + timerRef.current = {}; + Object.values(abortRef.current).forEach((c) => { + try { + c.abort(); + } catch { + // ignore + } + }); + abortRef.current = {}; + }, computeAutoSyncStart: vi.fn(() => 101), getChannelsInRange: vi.fn().mockResolvedValue({ occupants: [] }), getEPGs: vi.fn().mockResolvedValue([]),