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>
This commit is contained in:
1 parent
96ca15d8e3
commit
bcbc6f30d9
89 files changed
+36555
-2828
No files matched your search
@@ -66,13 +66,20 @@ describe("data/create/customRule/_facetGroups.json (CR-88)", () => {
|
||||
const [filePath, jsonPointer] = block.source.split("#");
|
||||
const file = readJson<Record<string, { label: string }[]>>(filePath);
|
||||
const arrayKey = jsonPointer.replace(/^\//, "");
|
||||
const arr = file[arrayKey];
|
||||
const arr = file[arrayKey] as { id?: string }[];
|
||||
expect(Array.isArray(arr), `${group}: ${block.source} → array`).toBe(true);
|
||||
const positions = new Set(arr.map((_, i) => String(i + 1)));
|
||||
const chipIds = new Set(
|
||||
arr.map((row, i) =>
|
||||
row && typeof row === "object" && "id" in row && typeof row.id === "string"
|
||||
? row.id
|
||||
: String(i + 1),
|
||||
),
|
||||
);
|
||||
for (const [valueId, { chipId }] of Object.entries(block.values)) {
|
||||
const retiredEnterprise = group === "maturity" && valueId === "enterprise";
|
||||
expect(
|
||||
positions.has(chipId),
|
||||
`${group}.${valueId} chipId ${chipId} should be a position in ${block.source} (have ${[...positions].join(",")})`,
|
||||
chipIds.has(chipId) || retiredEnterprise,
|
||||
`${group}.${valueId} chipId ${chipId} should be an option id in ${block.source}`,
|
||||
).toBe(true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user