From eff77e47ccfafa57f7be849ddd3a3f5c2367aab7 Mon Sep 17 00:00:00 2001 From: le king fu Date: Tue, 13 Oct 2026 21:33:37 -0400 Subject: [PATCH] test(onboarding): pin the order of CHECKLIST_ITEM_KEYS to the rows A mutation that moved "categories" after "manualCategory" in the constant survived: the rows come from computeChecklist, the constant only orders the skipped and acknowledged steps. Co-Authored-By: Claude Opus 5.5 --- src/utils/onboardingChecklist.test.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/utils/onboardingChecklist.test.ts b/src/utils/onboardingChecklist.test.ts index c740028..16d2c1e 100644 --- a/src/utils/onboardingChecklist.test.ts +++ b/src/utils/onboardingChecklist.test.ts @@ -1,6 +1,11 @@ import { describe, it, expect } from "vitest"; import { computeChecklist, shouldAcknowledgeVisitSteps } from "./onboardingChecklist"; -import type { ChecklistItemKey, OnboardingCounters } from "../shared/types"; +import { + CHECKLIST_ITEM_KEYS, + VISIT_STEP_KEYS, + type ChecklistItemKey, + type OnboardingCounters, +} from "../shared/types"; const zero: OnboardingCounters = { sources: 0, @@ -38,6 +43,12 @@ describe("computeChecklist — rows (#351)", () => { ]); }); + it("CHECKLIST_ITEM_KEYS lists the rows in their order, VISIT_STEP_KEYS the two visit steps", () => { + // The reducer keeps skipped and acknowledged steps in this order (`withStep`). + expect(CHECKLIST_ITEM_KEYS).toEqual(keys(zero)); + expect(VISIT_STEP_KEYS).toEqual(["categories", "reports"]); + }); + it("zero counters → only profile is done (1/8)", () => { const list = computeChecklist(zero, open); expect(doneKeys(zero)).toEqual(["profile"]);