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
jsdom with 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/button
ui/input
ui/dialog
ui/sidebar
- selected shared components under
src/components
Expectations
- Tests should live with clear browser/component structure
- Prefer semantic queries first
- Only add
data-testid when semantic queries are not stable enough
- Avoid snapshot-heavy testing
- Use React Testing Library patterns consistently
Implementation notes
packages/shared-ui/package.json currently 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.
Summary
Add browser/component tests for
packages/shared-uiusing 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-serverthat we can reuse. A small but real test foundation inshared-uiwould help us catch regressions in reusable primitives before they land in downstream apps/packages.Proposed direction
packages/shared-uijsdomwith React Testing Librarypipeline-serverSuggested scope
Start small with a few high-value primitives and compositions, for example:
ui/buttonui/inputui/dialogui/sidebarsrc/componentsExpectations
data-testidwhen semantic queries are not stable enoughImplementation notes
packages/shared-ui/package.jsoncurrently has no test script or Vitest configpipeline-serverNice follow-up
If the setup works well, we can later use the same pattern for other reusable frontend packages too.