Something went wrong. Try again.
Monorepo for Aesthetic.Computer aesthetic.computer
Something went wrong. Try again.
JavaScript
12345678910111213141516171819202122232425262728293031323334import assert from "node:assert/strict";import test from "node:test";
import { outline, spotlight } from "../lib/effects.mjs";
const fakeCdp = () => { const expressions = []; return { expressions, async eval(expression) { expressions.push(expression); if (expression.includes(".spotlight(") || expression.includes(".outline(")) { return { x:12, y:24, width:80, height:40 }; } return true; }, };};
test("spotlight waits for its animated label before reporting capture readiness", async () => { const cdp = fakeCdp(); const result = await spotlight(cdp, "#target", { label:"Stable label" });
assert.deepEqual(result, { x:12, y:24, width:80, height:40 }); assert.match(cdp.expressions.at(-1), /\.captureReady\(\)/);});
test("outline shares the same label readiness contract", async () => { const cdp = fakeCdp(); await outline(cdp, "#target", { label:"Stable label" });
assert.match(cdp.expressions.at(-1), /\.captureReady\(\)/);});