/** * @slowcook 0.17.6+ — recon shape-test emission. * * Reads mock UI files for a story and emits structural assertions to * `tests/integration/story-N-shape.test.tsx`. Pure deterministic; no LLM. * * Asserts SHAPE only (per `feedback_shape_tests_belong_to_recon_not_testgen`): * - testid presence + cardinality * - DOM containment (e.g. badge inside
) * - className tokens (visual/a11y signals like `rounded-full`, `min-h-[44px]`) * - CSS variable tokens (no inline hex/rgb) * * Never asserts WIRING (per `feedback_testgen_must_not_over_assert_mock`): * - No spied-on hooks, no import existence, no readFileSync of source * - No mock-only chrome (subtrees marked `data-mock-chrome="true"` are * mechanically excluded from the testid+class extraction) * * Test rendering uses plain props (no scenario-runtime), so mock-chrome * never actually renders in the test even if it weren't filtered. */ import { join } from "node:path"; export interface ExtractedShape { /** Component file scanned (mock-side). */ file: string; /** Testids found on non-mock-chrome JSX (deduped). */ testids: string[]; /** Visual className tokens worth preserving (subset; see TOKENS_OF_INTEREST). */ visualTokens: string[]; /** Whether the component renders any element with a `
` ancestor. */ hasHeader: boolean; /** Component name (best-effort). */ componentName: string | null; } /** * Scan a mock UI file, return the SHAPE-relevant facts after stripping * mock-only chrome subtrees. */ export declare function extractShape(absFile: string, repoRoot: string): ExtractedShape | null; export declare function stripMockChromeSubtrees(source: string): string; interface SynthOpts { story: string; shapes: ExtractedShape[]; } export declare function synthesiseShapeTestFile(opts: SynthOpts): string; /** * Walk mock/src/ + return any file that contains `story-N` in source * OR is referenced by a scenario file for the story. * * For 0.17.6 first cut: simple — any file under mock/src/components/ * that lives in a directory referenced by the story's scenario. * Conservative — caller can pass explicit list via --mock-files. */ export declare function findMockFilesForStory(repoRoot: string, story: string): string[]; export { join as _join }; //# sourceMappingURL=shape-emit.d.ts.map