Track HiveGrid Cloud planning reference
This commit is contained in:
1 parent
b3d5ea6764
commit
e341c5938a
5784 files changed
+1104929
-3
No files matched your search
@@ -0,0 +1,32 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { isBlockingAxeImpact, summarizeAxeViolations } from "../tests/e2e/utils/axe";
|
||||
|
||||
describe("summarizeAxeViolations", () => {
|
||||
it("deduplicates repeated advisory violations while preserving node counts", () => {
|
||||
const summary = summarizeAxeViolations([
|
||||
{ id: "color-contrast", impact: "moderate", help: "Elements must meet contrast", nodes: [{}, {}] },
|
||||
{ id: "color-contrast", impact: "moderate", help: "Elements must meet contrast", nodes: [{}] },
|
||||
{ id: "image-alt", impact: "minor", help: "Images must have alternate text", nodes: [{}] },
|
||||
]);
|
||||
|
||||
expect(summary).toEqual([
|
||||
{ id: "color-contrast", impact: "moderate", help: "Elements must meet contrast", nodes: 3 },
|
||||
{ id: "image-alt", impact: "minor", help: "Images must have alternate text", nodes: 1 },
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("isBlockingAxeImpact", () => {
|
||||
it("blocks critical and serious violations by default", () => {
|
||||
expect(isBlockingAxeImpact("critical", {} as NodeJS.ProcessEnv)).toBe(true);
|
||||
expect(isBlockingAxeImpact("serious", {} as NodeJS.ProcessEnv)).toBe(true);
|
||||
expect(isBlockingAxeImpact("moderate", {} as NodeJS.ProcessEnv)).toBe(false);
|
||||
expect(isBlockingAxeImpact("minor", {} as NodeJS.ProcessEnv)).toBe(false);
|
||||
});
|
||||
|
||||
it("also blocks moderate violations in strict readiness mode", () => {
|
||||
expect(isBlockingAxeImpact("moderate", { E2E_A11Y_STRICT: "1" } as NodeJS.ProcessEnv)).toBe(true);
|
||||
expect(isBlockingAxeImpact("minor", { E2E_A11Y_STRICT: "1" } as NodeJS.ProcessEnv)).toBe(false);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user