Repository navigation
test: cover webhook resend, stream card pin/copy-link, notification prefs - #1026
Merged
Merged
Conversation
…fication preferences Adds Vitest/Testing Library coverage for four previously-untested pieces of the app: - handleResend in WebhookSettings (success/failure toasts, calls resendDelivery, button disabled while in flight, only shown for failed deliveries with a stored payload) - handlePinToggle in StreamCard (pinStream/unpinStream, toasts, menu label swap) - handleCopyLink in StreamCard (writes <origin>/app/stream/<id> to the clipboard, does not navigate the card link, check icon shown then reset) - useNotificationPreferences / savePreferences / isNotificationTypeEnabled (defaults, persistence, corrupt-JSON fallback, save-error callback) No production code changes were needed — all four behaviors already exist and work as described in their issues; only test coverage was missing. Closes FlowwStar#919 Closes FlowwStar#918 Closes FlowwStar#916 Closes FlowwStar#915 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
@King-Boye 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! 🚀 |
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Vitest + Testing Library coverage for four previously-untested interactions. In all four cases the production behavior described in the issue already exists and works correctly on
main— only test coverage was missing, so no production code changes were made.__tests__/components/webhook-settings.test.tsx: new "resend delivery" describe block coveringhandleResend(callsresendDeliverywith the delivery, success/failure toasts, button disabled while in flight, resend action only rendered for failed deliveries that have a stored payload).__tests__/components/streams/stream-card-copy-link.test.tsx(new file): covershandleCopyLink— writes<origin>/app/stream/<id>to the clipboard, does not navigate the card's<Link>, shows the check icon then resets to the link icon.__tests__/components/streams/stream-card-menu.test.tsx: new "pin/unpin" describe block coveringhandlePinToggle— "Pin to top" callspinStreamwith a pinned toast, a pinned card shows "Unpin stream" and callsunpinStreamwith an unpinned toast.__tests__/hooks/use-notification-preferences.test.ts(new file): coversuseNotificationPreferences/isNotificationTypeEnabled— defaults when storage is empty, updates persist tolocalStorage,isNotificationTypeEnabledreflects saved preferences, corrupt JSON falls back to defaults, and theonSaveErrorcallback fires when persistence throws.Test plan
npm testpasses, including the new/updated test fileshandleResend,handleCopyLink,handlePinToggle, anduseNotificationPreferences(verified by reading currentmainsource for each — all four already implement the acceptance-criteria behavior)Closes #919
Closes #918
Closes #916
Closes #915
🤖 Generated with Claude Code