Announcements — QA Plan
1. Create + fan-out
| # | Scenario | Expected |
|---|---|---|
| 1.1 | Coach creates with title + content | 201; WS event to org:{id} room; push enqueued to N-1 members; PostHog event captured (prod) |
| 1.2 | Member tries to create | 403 |
| 1.3 | Create with empty title | 400 from DTO |
| 1.4 | Create with priority=true | UI shows priority badge; sort order respects |
| 1.5 | 500-member org | Push fan-out completes; verify queue handles chunking; no throttling errors |
| 1.6 | Author opts out of announcement push pref | Author still excluded; no push to author regardless |
| 1.7 | One member opts out of announcement pref | Push to that member skipped |
2. List + counts
| # | Scenario | Expected |
|---|---|---|
| 2.1 | Member fetches list | Returns rows with per-member readAt |
| 2.2 | Unread count | Matches DB truth (count where no announcement_reads row exists for me) |
| 2.3 | Priority sorted first | Verify order |
| 2.4 | Cursor pagination | Stable |
3. Read receipts
| # | Scenario | Expected |
|---|---|---|
| 3.1 | Member marks read | Row inserted; counts decrement |
| 3.2 | Member marks read twice | Idempotent; same row |
| 3.3 | Member of org A marks read for an announcement in org B | Should 403/404 — confirm in service |
4. WebSocket
| # | Scenario | Expected |
|---|---|---|
| 4.1 | Member connected → coach creates | Member’s UI receives announcement:new |
| 4.2 | Member offline → comes online later | Picks up via REST list — no replay over WS |
5. Detail view (staff)
| # | Scenario | Expected |
|---|---|---|
| 5.1 | Staff opens detail | Sees read receipts |
| 5.2 | Member opens detail endpoint | 403 (staff-only) — verify in code |
6. RTL + i18n
| # | Scenario | Expected |
|---|---|---|
| 6.1 | Hebrew content rendered | RTL preserved |
| 6.2 | Mixed Hebrew + English in content | Correct bidi |
7. Smoke
- Create announcement → push arrives on mobile.
- Bell badge updates after mark-read.
- Member from another org doesn’t see anything.