test(web): Add AmountInput tests and vitest setup - #712
Conversation
Closes TrusTrove#503 Add a colocated AmountInput.test.tsx covering the primary rendered states (default render, prop-driven overrides, styled preview) and interactions (onChange, disabled). Configure vitest with jsdom and @testing-library/jest-dom, add the vitest deps, and wire a web test step into the CI workflow.
|
@Oyintarede is attempting to deploy a commit to the K1NGD4VID Team on Vercel. A member of the Team first needs to authorize it. |
|
MergeKeeper review Scope: in scope for linked issue The pull request correctly adds the requested unit test file for AmountInput along with the necessary Vitest configuration, dependencies, and CI step. Reviewed commit: |
|
MergeKeeper merge status Status: blocked Reason: Next steps:
|
|
@Oyintarede Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Summary
Adds a colocated
AmountInput.test.tsxthat verifies the component's primary rendered states and interactions, plus the minimal vitest infrastructure needed to run web component tests.Changes
apps/web/components/shared/AmountInput.test.tsx— 5 test cases covering:disabled,required)onChangefires with the entered valueonChangedoes not fire while disabledshowPreview+previewValueare provided (includingpreviewLabeloverride and hidden-preview edge case)apps/web/vitest.config.mts+apps/web/vitest.setup.ts— jsdom environment,@alias, and jest-dom matchers.apps/web/package.json— addstestscript and dev deps (vitest,@testing-library/react,@testing-library/jest-dom,@testing-library/user-event,@vitejs/plugin-react,jsdom)..github/workflows/ci.yml— adds a web test step to the frontend CI job.Verification (all green locally)
pnpm --filter web exec tsc --noEmit— cleanpnpm build— succeedspnpm --filter web lint— cleanpnpm --filter web test— 5/5 tests passCloses #503