Skip to content

test: add coverage for Toasts.tsx - #676

Open
royalTreasure wants to merge 1 commit into
drydocs:mainfrom
royalTreasure:test/659-toasts-component-coverage
Open

test: add coverage for Toasts.tsx#676
royalTreasure wants to merge 1 commit into
drydocs:mainfrom
royalTreasure:test/659-toasts-component-coverage

Conversation

@royalTreasure

Copy link
Copy Markdown

closes #659

Summary

Toasts.tsx (the component rendering toast state) had no test coverage — only the underlying store (toast.test.ts) was tested. Added Toasts.test.tsx covering the component's per-kind rendering logic.

Changes

  • New apps/web/src/__tests__/components/Toasts.test.tsx, seeding the real useToastStore via setState (matching this repo's convention, e.g. VaultPanel.test.tsx's use of useWalletStore.setState).

Coverage added

  • Each toast kind (success/error/info) renders its correct icon and style classes.
  • An error toast gets role="alert" and aria-live="assertive""; success/info` toasts get neither.
  • Clicking a toast's dismiss button calls the store's dismiss with that toast's id, leaving other toasts untouched.

Verification

  • npx vitest run src/__tests__/components/Toasts.test.tsx — 4/4 pass.
  • Full apps/web suite: 83/83 tests pass (including the 4 new ones). 3 pre-existing test files (unrelated to Toasts) fail to even load, independent of this change — they error on resolving the @meridian/shared workspace import (e.g. useVaultActions.test.ts), which looks like a pre-existing workspace-linking/build gap in this environment, not something this PR touches.

@drips-wave

drips-wave Bot commented Aug 31, 2026

Copy link
Copy Markdown

@royalTreasure 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

@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

@royalTreasure is attempting to deploy a commit to the Collins' projects Team on Vercel.

A member of the Team first needs to authorize it.

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] Toasts.tsx (the rendering component) has no test coverage

1 participant