Added missing weight emails
Deploy / deploy-dev (push) Successful in 2m15s
Deploy / deploy-prod (push) Skipped

This commit is contained in:
blaisadmin
2026-09-05 22:51:39 -04:00
parent b4254a68fa
commit 5abc7f6174
13 changed files with 501 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
# Weight reminder tests
From the repository root, run the unit tests and builds:
```bash
npm ci --prefix backend
npm ci --prefix frontend
npm test --prefix backend
npm run build --prefix backend
npm run build --prefix frontend
```
The integration test uses real Postgres 16, Redis 7, two worker processes, and
Mailpit to capture SMTP messages locally. It requires Docker and free localhost
ports 25432, 26379, 21025, and 28025. Port 21026 must remain unused for the SMTP
failure check. Test addresses use `.test`; Mailpit does not relay mail externally.
```bash
docker compose -p flockpal-weight-test -f backend/test-integration/compose.weight-reminders.yml up -d --wait
node backend/test-integration/weightReminders.mjs
docker compose -p flockpal-weight-test -f backend/test-integration/compose.weight-reminders.yml down --volumes
```
Always run the last command when finished, including after a failed test. Start
fresh containers for each run. Postgres data is disposable and held in tmpfs.
The test overrides database, Redis, and SMTP environment variables to use only
these local services. It does not use the application's configured SMTP account.
Coverage includes repeatable schema initialization, overdue and recent weights,
birds without weights, memorial exclusions, accepted care roles, concurrent
claims, one scheduler across two workers, grouped emails, HTML escaping, flock
isolation, 48-hour repeats, fresh weight resets, SMTP failures and recovery,
worker shutdown, and disabling the scheduler. Repeat timing is tested by aging
delivery timestamps rather than waiting two days.