-
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Summary
Add browser/component tests for packages/shared-ui using Vitest and React Testing Library.
Why
We are starting to lean more heavily on shared UI primitives across the monorepo, and we now have a working browser-test pattern in packages/pipelines/pipeline-server that we can reuse. A small but real test foundation in shared-ui would help us catch regressions in reusable primitives before they land in downstream apps/packages.
Proposed direction
- Add a Vitest browser/component test setup for
packages/shared-ui - Use
jsdomwith React Testing Library - Keep the suite focused on behavior and accessibility rather than styling snapshots
- Follow the same general testing approach already used in
pipeline-server
Suggested scope
Start small with a few high-value primitives and compositions, for example:
ui/buttonui/inputui/dialogui/sidebar- selected shared components under
src/components
Expectations
- Tests should live with clear browser/component structure
- Prefer semantic queries first
- Only add
data-testidwhen semantic queries are not stable enough - Avoid snapshot-heavy testing
- Use React Testing Library patterns consistently
Implementation notes
packages/shared-ui/package.jsoncurrently has no test script or Vitest config- We can reuse the React Testing Library dependency set already proven in
pipeline-server - This is a good place to establish conventions for testing reusable UI primitives across the repo
Nice follow-up
If the setup works well, we can later use the same pattern for other reusable frontend packages too.
Reactions are currently unavailable