/*
Unit tests for task list a11y covering applyTaskListA11y. It also guards the documented public contract and regression-sensitive edge cases.
Not a contract source of truth — the module under test owns the authoritative behavior; fixtures are minimal scaffolding only.RFC-1311: Compass header sweep — declares the task suite's contract for test-file scaffold coverage.
*/
import { describe, expect, test } from "vitest";
import { applyTaskListA11y } from "../task-list-a11y.ts";
describe("applyTaskListA11y", () => {
test("hides micromark-style disabled checkbox", () => {
const html = '
Done item
';
expect(applyTaskListA11y(html)).toBe(
'
Done item
',
);
});
test("hides remark-style disabled checkbox (checked and unchecked)", () => {
const html =
'
Done
' +
'
Todo
';
expect(applyTaskListA11y(html)).toBe(
'
Done
' +
'
Todo
',
);
});
test("leaves enabled checkboxes untouched", () => {
const html = '';
expect(applyTaskListA11y(html)).toBe(html);
});
test("leaves non-checkbox disabled inputs untouched", () => {
const html = '';
expect(applyTaskListA11y(html)).toBe(html);
});
test("is idempotent — already-hidden checkbox unchanged", () => {
const html = '';
expect(applyTaskListA11y(html)).toBe(html);
});
test("handles self-closing input syntax", () => {
const html = '';
expect(applyTaskListA11y(html)).toBe('');
});
test("passes through html without task lists", () => {
const html = "