Files
pbakaus_impeccable/tests/skill-reference.test.mjs
T
Paul BakausandGitHub fc05472a20 Restore reduced-motion animation guidance (#540)
* Restore reduced-motion build guidance

Restores the accessibility requirement and verification step to the animation playbook, with a regression test that keeps it on the build path.

Implemented and validated with OpenAI Codex assistance under standing maintainer authorization.

* Harden reduced-motion guidance regression

Normalizes CRLF input and accepts either reduced-motion spelling so the contract stays portable and intent-focused.

Implemented and validated with OpenAI Codex assistance under standing maintainer authorization.

* Anchor skill reference test to its module

Resolve the repository fixture path from the test module so the regression test is independent of the caller's working directory.

This change was prepared with AI assistance under maintainer authorization.

* Clarify reduced-motion guidance

Replace the double negative in the canonical animation guidance and keep the source contract aligned with the clearer wording.

This change was prepared with AI assistance under maintainer authorization.
2026-08-08 15:49:43 -07:00

21 lines
927 B
JavaScript

import { describe, it } from 'node:test';
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
import { join } from 'node:path';
import { fileURLToPath } from 'node:url';
const ROOT = fileURLToPath(new URL('..', import.meta.url));
describe('skill reference authoring contracts', () => {
it('keeps reduced-motion guidance on the animation build path', () => {
const animate = readFileSync(join(ROOT, 'skill/reference/animate.md'), 'utf-8').replace(/\r\n?/g, '\n');
const accessibility = animate.match(/## Accessibility and control\n([\s\S]*?)\n## Verify/)?.[1] ?? '';
const verify = animate.match(/## Verify\n([\s\S]*?)(?:\n## |$)/)?.[1] ?? '';
assert.match(accessibility, /prefers-reduced-motion/);
assert.match(accessibility, /intentional alternative/);
assert.match(accessibility, /not disabling all motion/);
assert.match(verify, /reduced[- ]motion/i);
});
});