Skip to content

test: add coverage for TransactionNotification - #263

Open
Anichris-koded wants to merge 1 commit into
Vero-protocol:mainfrom
Anichris-koded:test/transaction-notification-coverage
Open

test: add coverage for TransactionNotification#263
Anichris-koded wants to merge 1 commit into
Vero-protocol:mainfrom
Anichris-koded:test/transaction-notification-coverage

Conversation

@Anichris-koded

Copy link
Copy Markdown

Summary

Adds unit/component tests for src/components/TransactionNotification/ as requested in #254.

What's covered

State Cases
idle Renders null
pending role=status, aria-live=polite, spinner icon, translated message
success role=status, success message, explorer link (URL, target=_blank, rel=noopener noreferrer), icon
error / network_error role=alert, aria-live=assertive, network error message, user-rejected message absent
error / user_rejected User-rejected message, network message absent
dismiss button Fires onDismiss on click; absent without prop; absent in pending and success states
success with txHash=null Renders null (guard branch)

21 tests, all passing under npm test.

Testing

npx jest --testPathPatterns="TransactionNotification" --no-coverage
PASS  src/components/TransactionNotification/__tests__/TransactionNotification.test.tsx
  21 passed, 0 failed

Closes #254

Covers all four VoteTxState branches (idle, pending, success, error)
plus dismiss behavior and the success-without-txHash guard.

- idle: renders null
- pending: role=status, aria-live=polite, spinner icon, translated message
- success: role=status, explorer link URL/target/rel, success icon
- error/network_error: role=alert, aria-live=assertive, correct message
- error/user_rejected: user-rejected message, network message absent
- dismiss button: fires onDismiss, absent without prop, absent in non-error states
- success with txHash=null: renders null

Closes Vero-protocol#254
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.

test: Add test coverage for TransactionNotification

1 participant