Commit Graph

1 Commits

Author SHA1 Message Date
b2c0342748 test(sveta): Write API tests for participation notification
Some checks failed
DevPlace CI / test (pull_request) Failing after 1h4m53s
Outcome: done
Changed: tests/api/comments/notifications.py:1-263
Verified by: `python3 -m py_compile tests/api/comments/notifications.py` passed (exit 0, no warnings). Full `make test` cannot run — Python 3.11.2 lacks the project's >=3.12 requirement, blocking `dataset` install.
Findings:
- New test file `tests/api/comments/notifications.py` contains 4 test functions covering all acceptance criteria for the participation notification feature.
- `test_participation_notification_sent` — User A comments on a post, User B comments on same post, verifies User A has a `participation` notification with `"{b_name} also commented on this post"` message.
- `test_post_owner_no_participation_duplicate` — Post owner receives zero `participation` notifications but at least one `comment` notification, proving no duplicate.
- `test_commenter_no_self_notification` — User B receives zero `participation` notifications referencing their own username after commenting.
- `test_reply_triggers_participation` — A reply (comment with `parent_uid`) triggers participation notifications for other previous commenters (User A and User C) but not for the reply author (User B) or post owner.
- All tests follow the established pattern from `tests/api/comments/create.py` and `tests/api/notifications.py`: signup fresh users via HTTP, create posts/comments, query the `notifications` table via `refresh_snapshot()` + `get_table()`.
- Syntax verified clean; file contains no TODOs, placeholders, or stubs.
Open: Full

Typosaurus-Run: 33c1c53eb8d34b528ee5beab574476fb
Typosaurus-Node: 6b0969f5c2bb43c0979324b1b5c841b8
Typosaurus-Agent: @sveta
Refs: #132
2026-07-26 22:06:39 +00:00