test(shared-ui): add React Testing Library coverage#563
Draft
test(shared-ui): add React Testing Library coverage#563
Conversation
Co-authored-by: luxass <40726067+luxass@users.noreply.github.com> Agent-Logs-Url: https://github.com/ucdjs/ucd/sessions/cc873705-3117-405b-b979-78e0e15a268c
Copilot
AI
changed the title
[WIP] Add React Testing Library coverage for shared-ui
test(shared-ui): add React Testing Library coverage
Mar 21, 2026
Contributor
🌏 Preview Deployments
Built from commit: 🤖 This comment will be updated automatically when you push new commits to this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
packages/shared-uihad no test infrastructure despite being a shared primitive library consumed across the monorepo. This adds a jsdom/RTL browser-test setup mirroring the pattern already established inpipeline-server.Setup
vitest,@testing-library/react,@testing-library/jest-dom,@testing-library/user-event,jsdomto devDependencies (all from existingcatalog:test)vitest.config.tsdefines a singleshared-ui-browserproject using jsdom, auto-discovered by the root workspace configtest/browser/setup.tsregisters jest-dom matchers, cleanup,matchMediapolyfill, andIS_REACT_ACT_ENVIRONMENTTests (38 total)
button— render, click, disabled, all 6 variants, 4 sizesinput— render, type,onChange, disabled, password type, placeholder, custom attributesbadge— render, defaultspantag,renderprop polymorphism, all 6 variantsdialog— closed state, open via trigger, close button, footer children,showCloseButton={false}Tests use semantic queries throughout (
getByRole,getByLabelText,getByPlaceholderText);data-testidis not used in any of these components.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.