Test ModUI Interfaces
Test the behavior affected by a change and the consumer contract it exposes. A renderer test, props-based composition test, source typecheck, library build and platform integration test establish different things.
Current commands
From the ModUI checkout:
pnpm test:run
pnpm test:coverage
pnpm typecheck
pnpm build
pnpm storybook:build
pnpm test is the interactive Vitest command. The reviewed Vitest configuration uses jsdom, globals and src/test/setup.ts, with tests matching src/**/*.{test,spec}.{ts,tsx}. Coverage uses the configured V8 provider. Do not use obsolete test:watch or c8 instructions without checking the current scripts.
Verify by layer
| Layer | Meaningful checks |
|---|---|
| Composition | Prop/model/event contracts, labels, keyboard interaction, disabled/error states and actual rendered values |
| Renderer | Valid/unknown discriminators, field/card references, store binding, display context and lazy resolution |
| Adapter | Supported v1 inputs translated to the expected native schema, preserving intended behavior |
| Store | Distinct form IDs, initial/reset values, touched/dirty state and error normalization |
| Builder | Edits produce the intended schema; selection/move/remove/serialization behavior remains consistent |
| Page | Config/item/formId contract, tabs, save/delete event handling and integration with its owned form |
| Consumer build | Declared package exports/types, shared styles and optional theme subpaths resolve |
For example, the documented ShowPage demo should load Alex, update the same form's first_name value after typing, and display its example validation error on that field. That validates local renderer/binding behavior; it does not create or authorize a platform attendee.
Existing fixtures and async behavior
Use the nearest source test as the fixture model. Renderer tests use active Pinia state and preload/clear lazy component caches where relevant. For asynchronous compositions, await their actual rendering or completion before asserting; a mounted wrapper alone can still contain a loading placeholder.
The setup file supplies browser shims needed by jsdom. That does not prove a device feature works in a real browser. Keep real camera, clipboard, scanner, pointer, focus and media acceptance separate where applicable.
Platform validation
Test an allowed principal and a denied principal when wiring save/delete/API services. Check the server result and persisted model, not only a changed local field. Hidden client controls and passing component tests cannot establish server authorization. Include the actual installed schema/library version and test both a supported legacy schema and the new one when migrating.
Before publishing, inspect the actual test result and suite count, source typecheck, build output and representative Storybook/consumer behavior. An empty suite, a skipped test or a stale generated manifest is not a successful contract check.
Source review
Reviewed against ModUI a57bc7fe8eb3f1aec2581be52388520463a7d6bf: package.json, vitest.config.ts, src/test/setup.ts, renderer/page/adapter/store tests and vite.config.ts on 2026-10-13. Detailed platform deployment and recovery stay in their separate runbooks.