Files
community-rule/tests/unit/methodCardFacetMatchesPresetForId.test.ts
T
adilalloandCursor bcbc6f30d9 Import the remade decks on stable ids and recommend one card per job, so a saved draft still loads after a chip is renamed.
The real-group profiles stay as a test, so a change that moves a pick fails.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-04 14:22:54 -07:00

48 lines
1.3 KiB
TypeScript

import { describe, expect, it } from "vitest";
import {
communicationPresetFor,
decisionApproachPresetFor,
} from "../../lib/create/finalReviewChipPresets";
import {
communicationMethodFacetMatchesPreset,
decisionApproachFacetMatchesPreset,
} from "../../lib/create/methodCardFacetMatchesPresetForId";
const uuid = "550e8400-e29b-41d4-a716-446655440000";
describe("methodCardFacetMatchesPresetForId", () => {
it("communication: matches fresh preset seed for an unknown id", () => {
const p = communicationPresetFor(uuid);
expect(communicationMethodFacetMatchesPreset(p, uuid)).toBe(true);
});
it("communication: mismatches when any section differs from preset", () => {
const p = communicationPresetFor(uuid);
expect(
communicationMethodFacetMatchesPreset(
{ ...p, corePrinciple: "edited" },
uuid,
),
).toBe(false);
});
it("decision approaches: ignores key-resource chip selections", () => {
const p = decisionApproachPresetFor(uuid);
expect(
decisionApproachFacetMatchesPreset(
{
...p,
selectedApplicableScope: ["Shared money"],
},
uuid,
),
).toBe(true);
expect(
decisionApproachFacetMatchesPreset(
{ ...p, corePrinciple: "edited" },
uuid,
),
).toBe(false);
});
});