From 66bdb19f44437db0eb31f870919d90bc7154fcf7 Mon Sep 17 00:00:00 2001 From: le king fu Date: Sun, 18 Oct 2026 20:30:42 -0400 Subject: [PATCH] test: correct the seed priority comment of the onboarding samples test (#384) The seed is not all priority 0: COSTCO and WALMART are at 50, COUCHE-TARD ESSENCE at 10. The comment now says why the mock's sort stays right: it sorts by descending priority like the SQL, and no line of either sample is matched by more than one seed keyword, so the order cannot move the counts. Co-Authored-By: Claude Opus 5.5 --- src/__integration__/onboarding-samples.test.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/__integration__/onboarding-samples.test.ts b/src/__integration__/onboarding-samples.test.ts index cddd3bb..f7a9fe8 100644 --- a/src/__integration__/onboarding-samples.test.ts +++ b/src/__integration__/onboarding-samples.test.ts @@ -225,8 +225,13 @@ describe("onboarding samples — seed categorisation (#354)", () => { "%s: the seed categorises the frozen share and leaves the hand-classified lines alone", async (name) => { const keywords = seedKeywords(); - // `categorizeBatch` asks for active keywords by descending priority; the - // seed is all priority 0, so the SQL order is the file order. + // `categorizeBatch` asks for the active keywords by descending priority + // and keeps the first one that matches. The seed is not all priority 0: + // COSTCO and WALMART are at 50, COUCHE-TARD ESSENCE at 10, the rest at 0. + // The mock sorts the same way; its sort is stable, so equal priorities + // keep the file order, which SQLite does not promise. Neither order moves + // the counts below: on 2026-10-18 no line of either sample matched more + // than one seed keyword (COSTCO WHOLESALE matches COSTCO alone). select.mockResolvedValue( [...keywords].sort((a, b) => b.priority - a.priority) );