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 <noreply@anthropic.com>
This commit is contained in:
le king fu 2026-10-13 21:33:37 -04:00
parent 64a07f359f
commit eff77e47cc

View file

@ -1,6 +1,11 @@
import { describe, it, expect } from "vitest"; import { describe, it, expect } from "vitest";
import { computeChecklist, shouldAcknowledgeVisitSteps } from "./onboardingChecklist"; 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 = { const zero: OnboardingCounters = {
sources: 0, 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)", () => { it("zero counters → only profile is done (1/8)", () => {
const list = computeChecklist(zero, open); const list = computeChecklist(zero, open);
expect(doneKeys(zero)).toEqual(["profile"]); expect(doneKeys(zero)).toEqual(["profile"]);