feat(onboarding): visit steps foundation, eight rows, "Got it" and one-time initialization (#425) #444

Merged
maximus merged 3 commits from issue-425-visit-steps into main 2026-10-16 00:37:50 +00:00
Showing only changes of commit eff77e47cc - Show all commits

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"]);