feat: complete spec-003 testing & cleanup #79
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "exe-dev-bot/market:impl/newsletter-testing-cleanup"
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
Completes the Testing & Clean Up section of spec-003 (Weekly Newsletter). Progress: 37/39 tasks — all code tasks done, 2 remaining are production rollout operations.
Changes
Image URL cleanup
/my/newsletters/[id]) to usegetNewsletterImagePaths()+ batchcreateSignedUrls()— same pattern as the delivery pipelineFix existing E2E tests (24 failures → 0)
New unit tests (+46)
New E2E tests (+10)
Infrastructure
email-utils.tswith pure functions (buildMimeMessage,generateMessageId,dotStuff) testable withoutcloudflare:socketscloudflare:socketsstub for VitestplatformProxyin Astro config for dev-moderuntime.envaccess.dev.varsto.gitignoreTest Results
Testing
just test-unit— all 322 tests passjust test-e2e— all 91 tests pass/newsletter/unsubscribe— shows error for missing token/newsletter/unsubscribe?token=invalid— shows error for invalid tokennewsletterandcontact_infotables unchangedRemaining rollout tasks (not code)
These 2 tasks are production operations to complete after merge:
UPDATE contact_info SET newsletter_enabled = true WHERE user_id = '<admin_id>' AND contact_type = 'email';UPDATE contact_info SET newsletter_enabled = true WHERE contact_type = 'email';- Fix connections.spec.ts loginWithPassword: use Supabase Auth API to get tokens, then set session cookie directly via browser context (the old approach used localStorage which doesn't work with SSR cookie-based auth) - Load env vars from .env file for test access to SUPABASE_URL/ANON_KEY - Fix strict mode violations: use { exact: true } or .first() for text selectors that matched both UI elements and Astro dev toolbar nodes - Auth, home-page, and theme-selector tests were failing due to a stale dev server (component hydration errors), not test issues Co-authored-by: Shelley <shelley@exe.dev>