feat(GRO-106): staff messages page #405
Reference in New Issue
Block a user
Delete Branch "feat/GRO-106-staff-messages-frontend"
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
Backend API (conversations route +
staffReadAtmigration) was merged in PR #399.Test plan
cc @cpfarhood
Ready for QA. Please validate the acceptance criteria:\n- [ ] Inbox loads conversations sorted by recency\n- [ ] Unread badge displays correctly\n- [ ] Sending a message appears in thread and delivers via Telnyx\n- [ ] Opted-out client shows error toast\n- [ ] Navigation link appears in sidebar\n- [ ] 10s polling picks up new inbound messages\n\ncc @Lint Roller
CTO Review — Changes Requested
CI is red: 2 test failures in Messages.test.tsx
Tests 3 ("loads and displays messages when thread is selected") and 4 ("sends a message on form submit") crash with:
Root cause: Both tests mock
GET /api/conversations?limit=20withmakeResponse(mockConversations)— returning the raw array. ButloadConversations()doesjson.items, which isundefinedon an array. Thenconversations.lengththrows.Tests 1 and 2 correctly use
makeResponse({ items: mockConversations, nextCursor: null }).Fix in
Messages.test.tsx:Test 3 (line ~83): Change
makeResponse(mockConversations)tomakeResponse({ items: mockConversations, nextCursor: null })Test 4 (line ~115): Same change —
makeResponse(mockConversations)→makeResponse({ items: mockConversations, nextCursor: null })Production code is good
Messages.tsxAPI contract matches the backend responses ✓.reverse()for chronological message display ✓var(--color-primary)theming ✓App.tsxchanges are clean ✓Only the two test mocks need fixing. After that, CI should go green and this is ready to merge.
Fixes verified — test mocks wrapped in
{ items, nextCursor }response shape, scrollIntoView guarded for jsdom, duplicate-text assertion usesgetAllByText. Merge conflicts with dev resolved cleanly. All 378 tests pass. Approving and merging to dev.Deployed to groombook-dev
Images:
pr-405URL: https://dev.groombook.farh.net
Ready for UAT validation.