From e5dc95757f7df90e2a123ac207d6bdcaeb4061ad Mon Sep 17 00:00:00 2001 From: Flaminel Date: Thu, 22 Oct 2026 12:59:34 +0300 Subject: [PATCH] fixed newest first e2e on tied added dates --- e2e/tests/live-arr-fast/seeker-selection.api.spec.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/e2e/tests/live-arr-fast/seeker-selection.api.spec.ts b/e2e/tests/live-arr-fast/seeker-selection.api.spec.ts index 9f8b1c30..fb6d05a0 100644 --- a/e2e/tests/live-arr-fast/seeker-selection.api.spec.ts +++ b/e2e/tests/live-arr-fast/seeker-selection.api.spec.ts @@ -80,7 +80,9 @@ test.describe('Seeker selection strategies', () => { const candidates = await monitorEveryMovie(); expect(candidates.length).toBeGreaterThan(1); - const newest = [...candidates].sort((a, b) => b.added.localeCompare(a.added))[0]; + // The seed adds both movies in the same second, and Radarr ignores edits to the date. + const newestAdded = Math.max(...candidates.map((c) => Date.parse(c.added))); + const newest = candidates.filter((c) => Date.parse(c.added) === newestAdded).map((c) => c.title); const instanceId = await arrangeInstance(api, RADARR, { config: { selectionStrategy: 'NewestFirst' } }); await triggerSeeker(api); @@ -88,7 +90,7 @@ test.describe('Seeker selection strategies', () => { await expect.poll(async () => (await listSearchEvents(api, instanceId)).length, { timeout: SETTLE_MS }).toBe(1); const event = await firstSearchEvent(api, instanceId); - expect(event?.itemTitle).toBe(newest.title); + expect(newest).toContain(event?.itemTitle); }); test("oldest search first follows the arr's last search time", async ({ api }) => {