feat(onboarding): visit steps foundation, eight rows, "Got it" and one-time initialization (#425) #444
1 changed files with 12 additions and 1 deletions
|
|
@ -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"]);
|
||||
|
|
|
|||
Loading…
Reference in a new issue