Skip to content

test(runtime): cover handleNotification dispatch (ADR-0030)#1488

Merged
xuyushun441-sys merged 1 commit into
mainfrom
test/adr-30-notification-dispatcher
Jun 1, 2026
Merged

test(runtime): cover handleNotification dispatch (ADR-0030)#1488
xuyushun441-sys merged 1 commit into
mainfrom
test/adr-30-notification-dispatcher

Conversation

@xuyushun441-sys
Copy link
Copy Markdown
Contributor

Follow-up to #1486. Adds dispatcher-level integration coverage for the /api/v1/notifications surface — the one seam #1486 verified only by type-check.

Cases (mirroring the existing handleAnalytics dispatcher tests):

  • GET /notificationslistInbox(userId, { read, type, limit }), asserts unreadCount in the envelope and the parsed read=false&limit=10 filters.
  • POST /notifications/readmarkRead(userId, ids) from the body.
  • POST /notifications/read/allmarkAllRead(userId).
  • Anonymous request → 401, service never called.
  • No notification service registered → unhandled (→ 404).

Note: this sandbox SIGKILLs the large-package tsup DTS builds (@objectstack/spec etc.), so I couldn't run the full @objectstack/runtime suite locally — relying on CI to execute it. The test is constructed to match the proven handleAnalytics test harness and the success/error response helpers. The substantive inbox logic is already covered by the 27 passing @objectstack/service-messaging unit tests in #1486.

🤖 Generated with Claude Code

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Error Error Jun 1, 2026 8:54pm

Request Review

Integration coverage for the /api/v1/notifications surface added in #1486:
GET → listInbox (with read/limit filters), POST /read → markRead, POST
/read/all → markAllRead, 401 for anonymous requests, and unhandled (→404)
when no notification service is registered. Mirrors the existing
handleAnalytics dispatcher tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@xuyushun441-sys xuyushun441-sys force-pushed the test/adr-30-notification-dispatcher branch from c35154f to 7c39006 Compare June 1, 2026 20:52
@xuyushun441-sys xuyushun441-sys merged commit 6bc3b18 into main Jun 1, 2026
13 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/s tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants