Skip to content

# test(e2e): add notification panel unread badge and bulk read tests (#3806) - #3831

Open
KartikeyG-world wants to merge 3 commits into
Priyanshu-byte-coder:mainfrom
KartikeyG-world:test/issue-3806-notifications-e2e
Open

KartikeyG-world wants to merge 3 commits into
Priyanshu-byte-coder:mainfrom
KartikeyG-world:test/issue-3806-notifications-e2e

Conversation

@KartikeyG-world

Copy link
Copy Markdown
Contributor

Closes #3806

Description

Adds Playwright E2E test coverage for the notification drawer, unread notification count badge, bulk mark-as-read on panel open, and clear all actions.

Key Changes

  • Added stateful notification mock in e2e/notifications.spec.js with unread notifications.
  • Verifies that the bell icon displays the numeric unread badge ("2") prior to opening.
  • Verifies that clicking the notification bell opens the drawer panel and displays the notification items.
  • Verifies that opening the panel triggers the automatic bulk read PATCH, clears the unread count badge on the bell icon, and displays "All caught up" in the header while keeping notifications listed.
  • Verifies the "Clear all" action removes notifications and renders the empty state ("No notifications yet").
  • Maintained exact one-commit-per-file discipline (1 commit for 1 modified file).

Architectural Note for Maintainers

  • The issue description mentions "Mark an individual notification as read". Inspection of src/app/api/notifications/route.ts and src/components/NotificationBell.tsx confirmed that DevTrack implements automatic bulk mark-as-read upon opening the panel (handleOpen), and has no individual notification mark-as-read UI button or endpoint. The test exercises this real implementation without artificial mocks.

Testing & Verification

  • pnpm run type-check: Passed with 0 errors.
  • git diff --check: 0 whitespace issues.

Contributor Notes (WOCS 2026)

  • Contributor: @KartikeyG-world
  • Branch: test/issue-3806-notifications-e2e -> main

@github-actions github-actions Bot added type:feature GSSoC type bonus: new feature type:testing GSSoC type bonus: tests (+10 pts) labels Nov 26, 2026

@Priyanshu-byte-coder Priyanshu-byte-coder left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid test, passes in CI. Same small thing as #3829: please drop the "Per Section 4.4 (No artificial implementation)" line from the comment, since that document doesn't exist here. Keeping the note that there's no per-item mark-as-read control is helpful. Then it's ready.

@Priyanshu-byte-coder Priyanshu-byte-coder added wocs Winter of Code Social 2026: counts for WOCS points level 2 WOCS: moderate, bug fixes/tests/small features (5 points) labels Nov 26, 2026
@github-actions

Copy link
Copy Markdown

Thanks for the PR, @KartikeyG-world! ❄️ This PR is tracked for Winter of Code Social 2026.

See CONTRIBUTING.md for the details.

@KartikeyG-world

Copy link
Copy Markdown
Contributor Author

@Priyanshu-byte-coder
I have commit the changes as per your requirement
Please check it out and let me know about the status
Thankyou

@Priyanshu-byte-coder Priyanshu-byte-coder left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the cleanup, ready to go.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

level 2 WOCS: moderate, bug fixes/tests/small features (5 points) type:feature GSSoC type bonus: new feature type:testing GSSoC type bonus: tests (+10 pts) wocs Winter of Code Social 2026: counts for WOCS points

Projects

None yet

Development

Successfully merging this pull request may close these issues.

E2E test: the notification panel

2 participants