Commit Graph

2 Commits

Author SHA1 Message Date
9eb1cc6cfa test(sveta): Write test: admin page renders participation notification defaults row
Outcome: done
Changed: tests/e2e/admin/notifications.py:53-90
Verified by: `python3 -m py_compile tests/e2e/admin/notifications.py` — compile: pass
Findings:
- New test `test_admin_page_renders_participation_defaults` at `tests/e2e/admin/notifications.py:53` fetches `GET /admin/notifications` with the admin's X-API-KEY and asserts the participation notification type row renders with label "Post participation", description "Someone else comments on a post you also commented on", and the correct default channel states: in_app=checked, push=checked, telegram=unchecked (matching `_NOTIFICATION_CHANNEL_DEFAULTS` at `devplacepy/database/notifications.py:34`)
- `NOTIFICATION_TYPES` at `devplacepy/database/notifications.py:15` includes `participation` with `label: "Post participation"` and description referencing "post you also commented on"
- `_notification_defaults_view()` at `devplacepy/routers/admin/notifications.py:24-34` iterates all `NOTIFICATION_TYPES` unconditionally, so participation is always included in the admin page
- Admin template `devplacepy/templates/admin_notifications.html:25-53` renders every `notification_defaults` entry with a table row containing data-toggle inputs for each channel
- Test follows existing patterns in the file: uses `requests` with `X-API-KEY` header, same `alice` fixture unpacking, same `_user_notification_prefs` helper
Open: Full test suite (`make test`) cannot run in this container — the environment has Python 3.11.2 but the project `require

Typosaurus-Run: 33c1c53eb8d34b528ee5beab574476fb
Typosaurus-Node: 950b129728bf4645b401c9210089f9f5
Typosaurus-Agent: @sveta
Refs: #132
2026-07-27 09:38:42 +00:00
43f4011005 chore: reorganize test files into domain-specific subdirectories under tests/
Split the monolithic test directory into three tiers (unit, api, e2e) with a path-mirroring directory structure. Added corresponding Makefile targets (test-unit, test-api, test-e2e) and updated all documentation references (CLAUDE.md, README.md, testing-cicd.html, testing-framework.html, testing-make.html) to reflect the new layout and naming conventions.
2026-06-13 14:32:33 +00:00