// tests/build/cursor-visibility.test.ts — Plan 04-06 cursor-visibility // defensive regression pin (RESEARCH Finding 4 closure). // // Pins that src/offscreen/recorder.ts:285 carries the `cursor: 'always'` // getDisplayMedia constraint — the original Phase-5 deferral was lifted // opportunistically in Plan 01-09 (recorder.ts:285) and the back-patched // Plan 04-06 closes the audit loop by both (a) re-verifying the literal // via this defensive grep test and (b) flipping the stale "deferred to // Phase 5" lines in .planning/phases/01-stabilize-video-pipeline/ // 01-07-SUMMARY.md (Task 3 of Plan 04-06). // // Polarity at land: GREEN-on-arrival — the literal already exists at // recorder.ts:285 (verified at 04-06 re-plan iter-2; confirmed via // `grep -n "cursor: 'always'" src/offscreen/recorder.ts`). // // SCOPE: node-env file-grep regression pin. Does NOT instantiate the // MediaStream pipeline (out of scope for unit tests; the runtime visibility // behavior is operator-empirical and out of the automated test loop — // per UI-SPEC § the operator confirms the cursor appears in // `video/last_30sec.webm` playback after a SAVE). // // References: // - .planning/phases/04-harden-clean-up-optional/04-RESEARCH.md // §Finding 4 (cursor visibility verification scope). // - .planning/phases/01-stabilize-video-pipeline/01-07-SUMMARY.md // (back-patched in Plan 04-06 Task 3 to remove the stale Phase-5 // deferral framing — the constraint shipped in Plan 01-09). // - https://www.w3.org/TR/screen-capture/#dom-mediatrackconstraintset-cursor // (W3C Screen Capture spec — `cursor` constraint values). import { describe, expect, it } from 'vitest'; import { readFileSync } from 'node:fs'; import { resolve as resolvePath } from 'node:path'; const RECORDER_PATH = resolvePath( process.cwd(), 'src/offscreen/recorder.ts', ); describe("cursor visibility constraint shipped (Plan 01-09 -> verified Plan 04-06)", () => { it("src/offscreen/recorder.ts contains the cursor: 'always' getDisplayMedia constraint literal", () => { const text = readFileSync(RECORDER_PATH, 'utf8'); expect(text).toContain("cursor: 'always'"); }); });