π Description
The toast system β lib/context/ToastContext.tsx, components/ToastRegion.tsx, components/Toast.tsx β is used for success/error feedback across the app (e.g. the Send confirmation in app/send/page.tsx). It is untested, even though toast queue/auto-dismiss/aria-live behavior is easy to break.
Why this matters: toasts are the primary feedback channel for money actions. If a success toast silently fails to render, or auto-dismiss races a second toast, users lose confirmation that their transfer happened.
π― Requirements & Context
Functional requirements
Context & constraints
- Vitest is configured for
environment: node; for DOM/component rendering you may need to set the test file's environment to jsdom (document this in the test file via the Vitest environment docblock).
- Keep tests deterministic with
vi.useFakeTimers().
π οΈ Suggested Execution
git checkout -b test/toast-system
- Write the suite, set jsdom environment for component rendering, assert a11y region.
npm run lint
npm run test:coverage
- Edge cases: rapid sequential toasts, dismiss during auto-dismiss timer, max queue length, reduced motion (no animation dependency in assertions).
Example commit message
test(toast): cover ToastContext queue + ToastRegion aria-live
Adds Vitest suite for enqueue/auto-dismiss/manual-dismiss and asserts
the live region announces toasts.
β
Acceptance Criteria & Guidelines
| Requirement |
Target |
| Queue + auto/manual dismiss covered |
Required |
| aria-live region asserted |
Required |
| Toast system coverage |
β₯ 85% |
| Deterministic (fake timers) |
Required |
| Lint clean |
Required |
| Timeframe |
96 hours from assignment |
π¬ Community & Support
Join the RemitWise contributor community on Discord: https://discord.gg/CtQuPZFMA
Comment to claim before starting. π
π Description
The toast system β
lib/context/ToastContext.tsx,components/ToastRegion.tsx,components/Toast.tsxβ is used for success/error feedback across the app (e.g. the Send confirmation inapp/send/page.tsx). It is untested, even though toast queue/auto-dismiss/aria-livebehavior is easy to break.π― Requirements & Context
Functional requirements
ToastContextcovering: enqueue, multiple toasts, auto-dismiss timing, manual dismiss, and variant handling (success/error/warn).ToastRegionexposes an appropriatearia-liveregion and that toasts are announced.Context & constraints
environment: node; for DOM/component rendering you may need to set the test file's environment tojsdom(document this in the test file via the Vitest environment docblock).vi.useFakeTimers().π οΈ Suggested Execution
Example commit message
β Acceptance Criteria & Guidelines
π¬ Community & Support
Join the RemitWise contributor community on Discord: https://discord.gg/CtQuPZFMA
Comment to claim before starting. π