/** * Agent-drivability as a red/green property, not a hope. * * A stated goal of this library is that **Playwright MCP and AI * agents can drive the fleet's apps**, and that reduces to one * mechanical requirement: `getByRole(role, { name })` finds exactly * one thing. The fleet fails it comprehensively today — * plex-channels' icon buttons are bare glyphs (`↶`, `↷`, `▶`), * mux-magic's status pills are `
`s with no role, lounge-tv has * zero `aria-*` attributes — and every one of those failures is * invisible in a browser and invisible to axe. * * So every component's story calls this, and the assertion is the * same one Playwright will make. * * Deliberately dependency-free — no `expect`, no jest-dom, no * testing-library import. This ships in `@charcuterie/ui/testing` * for consumers to use on *their* components, and a published * package should not drag a test framework into an app's dependency * graph to do it. Plain `Error`s with actionable messages work in a * story `play`, in Vitest, in Playwright, and in a scratch script. */ /** * The subset of a testing-library query object this needs — * structural, so Storybook's `canvas`, a `within(element)` result, * and `screen` all satisfy it without an import. */ export type AgentQueries = { queryAllByRole: (role: string, options?: { name?: RegExp | string; }) => HTMLElement[]; }; export type AgentTarget = { name?: RegExp | string; role: string; }; /** * Asserts the control an agent would reach for is reachable, unique, * and keyboard-operable. Returns it, so a caller can go on to assert * something specific about it. */ export declare const expectAgentDrivable: (canvas: AgentQueries, target: AgentTarget) => HTMLElement; /** * The other half of the contract, for decoration. * * A `Skeleton` that assistive technology can see is a screen reader * reading three empty bars, and an agent finding a "loading" element * it cannot act on. Asserting the *absence* of a role is how that * stays true — axe will not tell you, because there is nothing * invalid about it. */ export declare const expectHiddenFromAgents: (element: Element) => void; //# sourceMappingURL=expectAgentDrivable.d.ts.map