codefloe/forgejo-codefloe
Watch
4
12
Fork
You've already forked forgejo-codefloe
0

test(notification): regression guard for unified release-notification list #38

Merged
pat-s merged 1 commit from test/release-notification-regression into v15.0/forgejo-codefloe 2026-06-02 09:40:38 +00:00
Owner

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-templates nor go vet could 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, tag v1.1) and one read (release id 5, tag v1.0).
  • tests/integration/release_notification_test.go — TestNotificationReleaseUnifiedList pins three contracts:
    • The unread tab renders the release notification's .notifications-link at /user2/repo1/releases/tag/v1.1 alongside user1's existing unread issue notification.
    • The .notifications-unread-count badge equals the combined count (2) and is not tw-hidden.
    • The read tab shows the read release (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.
## 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-templates` nor `go vet` could 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, tag `v1.1`) and one read (release id 5, tag `v1.0`). - `tests/integration/release_notification_test.go` — `TestNotificationReleaseUnifiedList` pins three contracts: - The unread tab renders the release notification's `.notifications-link` at `/user2/repo1/releases/tag/v1.1` alongside user1's existing unread issue notification. - The `.notifications-unread-count` badge equals the combined count (`2`) and is not `tw-hidden`. - The read tab shows the read release (`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.
test(notification): regression guard for unified release-notification list
All checks were successful
testing / frontend-checks (pull_request) Successful in 2m2s
testing / backend-checks (pull_request) Successful in 13m41s
testing / test-unit (pull_request) Successful in 18m9s
testing / test-remote-cacher (redict) (pull_request) Successful in 2m58s
testing / test-remote-cacher (garnet) (pull_request) Successful in 3m0s
testing / test-mysql (pull_request) Successful in 30m35s
testing / test-remote-cacher (valkey) (pull_request) Successful in 5m7s
testing / test-remote-cacher (redis) (pull_request) Successful in 5m26s
testing / test-e2e (pull_request) Successful in 31m39s
testing / test-sqlite (pull_request) Successful in 36m42s
testing / test-pgsql (pull_request) Successful in 43m53s
milestone / set (pull_request_target) Has been skipped
issue-labels / backporting (pull_request_target) Has been skipped
3d085c2686
Add a fixture (`models/fixtures/release_notification.yml`) and an
integration test (`tests/integration/release_notification_test.go`) that
exercise the unified `/notifications` list end-to-end.

The previous incarnation of the bug, fixed in #37, looked like
`Unread(N)` on the navbar bell over an empty list: the badge callback
summed issue + release notifications, but the template iterated only
`.Notifications` (issue-only) because the unified-list body was lost
in an upstream-merge conflict resolution. A `make lint-templates` or
`go vet` couldn't catch that — only rendering the page does.

The test pins three contracts that together would have failed against
the broken template:
- The unread tab renders a release notification's `.notifications-link`
  at `/<owner>/<repo>/releases/tag/<tag>`.
- The unread badge text equals the combined issue+release count.
- The read tab filters by status (read release shows, unread doesn't).

Scoped to user1 (one existing unread issue fixture + the two new
release-notification rows) so it does not perturb `TestNotification`
(user2) or the navbar-count delta assertions in
`TestPullView_SelfReviewNotification`.
pat-s merged commit 3691a81997 into v15.0/forgejo-codefloe 2026-06-02 09:40:38 +00:00
pat-s deleted branch test/release-notification-regression 2026-06-02 09:40:39 +00:00
Sign in to join this conversation.
No reviewers
No milestone
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
codefloe/forgejo-codefloe!38
No description provided.