2 Commits

Author SHA1 Message Date
Zachary Lowden 02dd17186f fix(preview): run article spec as mod (article.upsert is rate-limited 1/day) (#2488)
The article spec (#2485) 429'd on real PRs (caught on PR 2487): article.upsert
is rate-limited to a HARD 1/day per user (articleRateLimits), and the ci-smoke
fixtures are shared across all concurrent previews — so after the first preview
of the day creates the one allowed article as `tester`, every later preview 429s
(TOO_MANY_REQUESTS). It passed in #2485 only because that was the day's first
create.

The rateLimit middleware bypasses moderators entirely (`if (ctx.user.isModerator)
return next()`), so run the spec as the `mod` fixture — the only way to author an
article reliably from the shared fixtures. No seed/createdAt change helps: even an
established account is capped at 1/day.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-11 19:20:37 -05:00
Zachary Lowden de1f120712 test(preview): cover the article authoring write path (article.upsert) (#2485)
Adds preview-article.spec.ts for article creation — a distinct content type
(/articles) not otherwise covered. Self-contained + per-run seeded (same pattern
as preview-engagement/collections): tester creates its own draft article with a
unique token, reads it back by id (getById) to deterministically confirm the
title persisted, then best-effort deletes it. No shared-entity collision (each
run's article is unique). Report-only.

The articleCreate feature flag is ['public'] (all logged-in users), so the
gate-passing fixture clears isFlagProtected('articleCreate').

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-11 17:54:36 -05:00