test(notifications): add unit tests for notification refactor #24

Closed
Gravity Bot wants to merge 0 commits from feature/826-notification-tests into release/v0.3.1
Contributor

Summary

12 unit tests covering the notifications refactor:

  • Notification type constants validation
  • NotifIcon() and NotifIconColor() for all 5 type variants
  • RespondNotification handler auth guard (no user, invalid UUID)
  • Legacy /invites route redirects to /user/settings/notifications
  • trySendInviteEmail nil-safety (nil emailer, not configured, no email)
  • buildInviteEmailHTML content checks (sender, dashboard, permission, links)
  • NotificationPrefsUpdate handler auth guard
  • NotificationPreference model struct validation

All tests pass with -race flag.

Closes OP#826

## Summary 12 unit tests covering the notifications refactor: - Notification type constants validation - `NotifIcon()` and `NotifIconColor()` for all 5 type variants - `RespondNotification` handler auth guard (no user, invalid UUID) - Legacy `/invites` route redirects to `/user/settings/notifications` - `trySendInviteEmail` nil-safety (nil emailer, not configured, no email) - `buildInviteEmailHTML` content checks (sender, dashboard, permission, links) - `NotificationPrefsUpdate` handler auth guard - `NotificationPreference` model struct validation All tests pass with `-race` flag. Closes OP#826
refactor: rename invites to notifications
All checks were successful
CI / lint (pull_request) Successful in 1m37s
CI / security (pull_request) Successful in 1m53s
CI / build (pull_request) Successful in 1m57s
CI / test (pull_request) Successful in 2m10s
0162b51642
Rename all "invites" references to "notifications" throughout:
- DB migration: dashboard_invites table → notifications
- Models: DashboardInvite → Notification, InviteView → NotificationView
- Services: SendInvite → SendNotification, etc.
- Handlers: Invites → Notifications, RespondInvite → RespondNotification
- Routes: /invites → /notifications (with legacy redirects)
- Templates: updated sidebar label, icons, and component names
- Tests: updated route assertions

Closes OP#211

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
feat(notifications): extend notification system with multiple types
All checks were successful
CI / security (pull_request) Successful in 1m7s
CI / build (pull_request) Successful in 2m1s
CI / test (pull_request) Successful in 2m13s
CI / lint (pull_request) Successful in 2m47s
58e2249469
Add notification types (invite, dashboard_shared, dashboard_updated,
system) with type-specific icons/colors, read/unread tracking, and
generic notification creation. Update notifications page with
type-aware rendering, unread indicators, and status badges.

New service methods: CreateNotification, ListNotifications,
UnreadNotificationCount, MarkNotificationRead, MarkAllNotificationsRead.

Closes OP#824

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
feat(notifications): add bell icon with unread badge in navbar
All checks were successful
CI / security (pull_request) Successful in 2m3s
CI / build (pull_request) Successful in 2m11s
CI / test (pull_request) Successful in 2m24s
CI / lint (pull_request) Successful in 2m54s
74ae2940b5
Show notification bell between edit toggle and user dropdown. Red badge
displays unread count, hidden when 0. Links to notifications settings
page. Count queried via UnreadNotificationCount service method.

Closes OP#825

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
feat(notifications): add subscription preferences per notification type
All checks were successful
CI / lint (pull_request) Successful in 1m30s
CI / security (pull_request) Successful in 1m50s
CI / build (pull_request) Successful in 1m53s
CI / test (pull_request) Successful in 2m7s
993a267222
Add notification_preferences table and UI for users to control email
notifications per type (invite, shared, updated, system). Email toggles
are only shown when SMTP is configured by the admin.

Closes OP#166

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
feat(notifications): add email notification for dashboard invites
All checks were successful
CI / security (pull_request) Successful in 1m15s
CI / build (pull_request) Successful in 2m3s
CI / test (pull_request) Successful in 2m20s
CI / lint (pull_request) Successful in 2m54s
5e2fd11c0a
Wire up optional email sending when a dashboard is shared. Checks SMTP
availability and user notification preferences before sending. Email
includes accept link and unsubscribe footer.

The NotificationEmailSender interface is nil-safe — email is inactive
until the SMTP service is wired in after branch merge.

Closes OP#165

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
test(notifications): add unit tests for notification refactor
All checks were successful
CI / test (pull_request) Successful in 1m34s
CI / security (pull_request) Successful in 1m50s
CI / build (pull_request) Successful in 1m55s
CI / lint (pull_request) Successful in 2m45s
2fc142b516
Test notification type constants, icon/color methods, handler auth
guards, legacy route redirects, invite email sending (nil-safe, not
configured, no email), email HTML content, and preference model.

Closes OP#826

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Gravity Bot closed this pull request 2026-02-17 21:20:25 +00:00
All checks were successful
CI / test (pull_request) Successful in 1m34s
CI / security (pull_request) Successful in 1m50s
CI / build (pull_request) Successful in 1m55s
CI / lint (pull_request) Successful in 2m45s

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mike/gashy!24
No description provided.