Skip to content

Add RTL tests for the TransactionProgressModal pending, success, and failed statesΒ #737

Description

@1nonlypiece

πŸ“Œ Description

src/app/TransactionProgressModal.tsx drives the pending β†’ submitted β†’ success
/ failed transaction lifecycle and (per the design issues) a copy-hash and retry
affordance. It currently has no test file, so its state transitions and retry
callback are unverified.

Goal: cover each transaction state's rendering plus the retry and copy-hash
actions.

🎯 Requirements and Context

  • Assert distinct rendering for pending, submitted, success, and failed states.
  • On failed, assert a retry control invokes the retry handler.
  • On success/submitted, assert the transaction hash renders and copy-to-clipboard
    is wired (mock navigator.clipboard).
  • Verify the modal closes via its close handler and never throws when a hash is
    absent.

πŸ› οΈ Suggested Execution

1. Fork the repo and create a branch

git checkout -b test/transaction-progress-modal

2. Implement changes

  • Add src/app/__tests__/TransactionProgressModal.test.tsx (RTL + Vitest).
  • Stub navigator.clipboard.writeText and assert it is called with the hash.

3. Test and commit

  • Run the repo suite: pnpm test
  • Edge cases: failed with no hash, clipboard rejection, retry while pending.

Example commit message

test: cover TransactionProgressModal states, retry, and copy-hash

βœ… Guidelines

  • Minimum 95% test coverage on the component under test.
  • Clear, reviewer-friendly test names.
  • Timeframe: 96 hours.

🏷️ Labels

type-testing Β· area-frontend Β· MAYBE REWARDED Β· GRANTFOX OSS Β·
OFFICIAL CAMPAIGN

πŸ’¬ Community & Support

  • Join the CommitLabs contributor Discord: https://discord.gg/WV7tdYkJk
  • Please introduce yourself before you start so we can avoid duplicate work.

Metadata

Metadata

Assignees

Labels

GRANTFOX OSSGrantFox open-source campaignMAYBE REWARDEDEligible for GrantFox rewardOFFICIAL CAMPAIGNOfficial GrantFox campaign issueStellar WaveIssues in the Stellar wave programarea-frontendFrontend / UI worktype-testingTests and test coverage

Type

Fields

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions