mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-14 10:34:06 +02:00
# Description of Changes De-AI comments and fix ridiculously indented code
26 lines
1.0 KiB
TypeScript
26 lines
1.0 KiB
TypeScript
import { describe, it, expect } from "vitest";
|
|
import { POLICY_CATEGORIES, POLICY_CONFIG } from "@app/data/policyDefinitions";
|
|
|
|
describe("policy definitions integrity", () => {
|
|
it("every category has a matching config entry", () => {
|
|
for (const cat of POLICY_CATEGORIES) {
|
|
expect(POLICY_CONFIG[cat.id], `config for ${cat.id}`).toBeDefined();
|
|
// A category may have no policy-level setting fields; fields is required
|
|
// but can be empty.
|
|
expect(Array.isArray(POLICY_CONFIG[cat.id].fields)).toBe(true);
|
|
expect(POLICY_CONFIG[cat.id].rules.length).toBeGreaterThan(0);
|
|
// Every preset seeds a real, non-empty pipeline (the category→steps map).
|
|
expect(
|
|
POLICY_CONFIG[cat.id].defaultOperations.length,
|
|
`defaultOperations for ${cat.id}`,
|
|
).toBeGreaterThan(0);
|
|
}
|
|
});
|
|
it("field keys are unique within each category", () => {
|
|
for (const cat of POLICY_CATEGORIES) {
|
|
const keys = POLICY_CONFIG[cat.id].fields.map((f) => f.key);
|
|
expect(new Set(keys).size).toBe(keys.length);
|
|
}
|
|
});
|
|
});
|