test(notification): regression guard for unified release-notification list #38
No reviewers
Labels
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
codefloe/forgejo-codefloe!38
Loading…
Reference in a new issue
No description provided.
Delete branch "test/release-notification-regression"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Regression guard for #37.
That PR fixed
Unread(N)on the navbar bell over an empty notification list — the template was iterating.Notifications(issue-only) while the unread-badge callback summed issue + release notifications.Neither
make lint-templatesnorgo vetcould catch that; only rendering the page does.What's added
models/fixtures/release_notification.yml— two rows for user1 on/user2/repo1: one unread (release id 1, tagv1.1) and one read (release id 5, tagv1.0).tests/integration/release_notification_test.go—TestNotificationReleaseUnifiedListpins three contracts:.notifications-linkat/user2/repo1/releases/tag/v1.1alongside user1's existing unread issue notification..notifications-unread-countbadge equals the combined count (2) and is nottw-hidden.v1.0) and does not leak the unread one.If a future upstream-merge conflict (or any other change) wipes the unified-list template body again, these subtests fail before the binary ships.
Scope considerations
Fixture rows are scoped to user1 so they don't perturb:
TestNotification— uses user2.TestPullView_SelfReviewNotification— asserts navbar-count deltas, not absolute values, so a different user1 baseline is fine.