Skip to content

test(web): Add AmountInput tests and vitest setup - #712

Open
Oyintarede wants to merge 4 commits into
TrusTrove:mainfrom
Oyintarede:test/amount-input
Open

test(web): Add AmountInput tests and vitest setup#712
Oyintarede wants to merge 4 commits into
TrusTrove:mainfrom
Oyintarede:test/amount-input

Conversation

@Oyintarede

Copy link
Copy Markdown
Contributor

Summary

Adds a colocated AmountInput.test.tsx that 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:
    • default render with only required props (input type/step/min/placeholder/value, label, asset ticker, and no preview)
    • prop-driven overrides (custom label, placeholder, asset, disabled, required)
    • onChange fires with the entered value
    • onChange does not fire while disabled
    • styled preview only when showPreview + previewValue are provided (including previewLabel override 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 — adds test script 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 — clean
  • pnpm build — succeeds
  • pnpm --filter web lint — clean
  • pnpm --filter web test — 5/5 tests pass

Closes #503

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.
@vercel

vercel Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

@Oyintarede is attempting to deploy a commit to the K1NGD4VID Team on Vercel.

A member of the Team first needs to authorize it.

@mergekeeper

mergekeeper Bot commented Aug 30, 2026

Copy link
Copy Markdown

MergeKeeper review

Scope: in scope for linked issue #503.
Verdict: clean

The pull request correctly adds the requested unit test file for AmountInput along with the necessary Vitest configuration, dependencies, and CI step.

Reviewed commit: 0992d2a462e2902a01963fdac80e78c0dd410efb.
CI and merge eligibility are checked separately.

@mergekeeper

mergekeeper Bot commented Aug 30, 2026

Copy link
Copy Markdown

MergeKeeper merge status

Status: blocked
PR state: open
Mergeability: mergeable
Checked commit: 0992d2a462e2902a01963fdac80e78c0dd410efb.

Reason:
GitHub pull request merge request failed with 403: Resource not accessible by integration

Next steps:
GitHub rejected this as a permissions/ruleset problem, not a review problem — a maintainer merge override cannot force this through.

  1. Confirm the MergeKeeper GitHub App has Contents: Read & write and Pull requests: Read & write permissions for this repository.
  2. If this repository uses a ruleset, add the MergeKeeper GitHub App as a Bypass actor on it (Settings → Rules → Rulesets → the ruleset → Bypass list) — this is what the "bypass rules" checkbox on GitHub's merge button represents, and MergeKeeper can only do the same once it's listed there.
  3. Retry the merge once either is fixed.

@drips-wave

drips-wave Bot commented Aug 30, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@mergekeeper mergekeeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

Successfully added the colocated AmountInput unit test file along with the necessary Vitest setup and CI configuration.

@mergekeeper mergekeeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

The pull request correctly adds the requested unit test file for AmountInput along with the necessary Vitest configuration, dependencies, and CI step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Easy] test(web): add unit test file for AmountInput

1 participant