Skip to content

Add publishing, newsletter, authorization and Chrome regression coverage - #92

Merged
philipithomas merged 3 commits into
mainfrom
codex/postcard-regression-tests
Sep 5, 2026
Merged

philipithomas merged 3 commits into
mainfrom
codex/postcard-regression-tests

Conversation

@philipithomas

@philipithomas philipithomas commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Postcard had little coverage of authoring, subscriber permissions, or actual newsletter delivery. Add 42 Rails regressions and four real Chrome editor tests, with both SOLO and MULTIUSER runs in CI.

The tests exercise draft/save/review/publish/edit/archive flows, guest and cross-account requests, sitemap and discovery visibility, rendered mail and signed tracking redirects, unsubscribe isolation and queued consent changes, CSV normalization, repeat imports, and import/export authorization. Chrome loads the production Stimulus controller and checks literal titles, autosave, Enter handling, reconnect cleanup, and cancelled pending saves.

Fix the defects exposed by these tests: published draft URLs looped, invalid direct publication raised, empty public archives crashed, sitemap entries contained multiple locations, unauthorized import approval raised instead of returning 403, queued imports ignored revoked approval, and the title editor interpreted HTML and leaked listeners/pending saves.

Add bin/test to initialize coverage and block unexpected HTTP before Rails boots. Publish separate HTML/JSON line and branch coverage reports per application mode. CI uses locked npm dependencies and Node 24 for Chrome tests. Document focused runs and test conventions in docs/testing.md.

Validation:

  • SOLO: 69 tests / 508 assertions, no failures, errors, or skips.
  • MULTIUSER with eager loading: 69 tests / 508 assertions, no failures, errors, or skips.
  • Chrome: 4 passing tests; the original controller fails 3 of them.
  • Zeitwerk passes; Brakeman reports no new warnings.
  • Compatibility with the six earlier audit branches, including Rails 8.1: 181 tests / 1,287 assertions in each mode and all 6 Chrome tests pass. Combined coverage is 63.46% / 63.83% line and 51.24% / 51.66% branch (SOLO / MULTIUSER). Local integration commit: 8edfbdb7bfbd304c3cb7534ab64a6d747dd941e9.
  • Coverage includes unexecuted app/lib files: 38.93% line / 36.20% branch in SOLO; 39.96% / 36.07% in MULTIUSER. Covered publishing/import paths are substantially higher; no artificial percentage gate is added.

This branch starts from main and remains independent of the other audit PRs. Durable newsletter retry/idempotency (#81), live provider behavior, and payment integration are still separate work.

Fixes #33. Fixes #34.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-05T18:59:55.546499Z bc98366 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@philipithomas
philipithomas merged commit eabfc6d into main Sep 5, 2026
4 checks passed
@philipithomas
philipithomas deleted the codex/postcard-regression-tests branch September 5, 2026 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: innerHTML assignment from user input in editable_controller.js Bug: Event listener memory leak in editable_controller.js

1 participant