Preconditions
Fixture event has upload permissions, sample image/GIF assets, missing-alt variant, oversized variant, and empty-audience segment.
Happy path
Upload asset.
Uploader validates MIME, size, progress, and R2 persistence.
Set sizing.
Width and height clamps keep email images responsive.
Preview and send.
Missing alt and oversized warnings block or warn according to policy.
Failure modes
Send blocked on validation failure
Trigger: asset lacks required metadata or sizing is invalid.
Resolution: 400 validation blocks send and no email leaves.
Bounced recipient tracked and suppressed
Trigger: image email bounces.
Resolution: email_events records bounce and suppression prevents future sends.
Scheduled-message edit window
Trigger: scheduled asset-backed email is edited after cutoff.
Resolution: 409 PAST_EDIT_WINDOW.
Retry on transient failure
Trigger: provider 5xx.
Resolution: retry uses same Idempotency-Key and sent_count remains one.
Idempotency-key on test-send
Trigger: test-send double-click.
Resolution: one asset-backed test email is sent.
Recipient resolution empty
Trigger: audience resolves to zero.
Resolution: 409 NO_RECIPIENTS with empty-audience copy.
Token rendering fallback
Trigger: image caption token is missing.
Resolution: fallback text renders, not blank caption.
Cancel scheduled before send
Trigger: scheduled asset email is cancelled.
Resolution: queue drains, sends refund, and audit row is written.
Missing-alt warning
Trigger: image/GIF has no alt text.
Resolution: preview surfaces visible warning before render/send.
Oversized image clamp
Trigger: uploaded asset exceeds email-safe dimensions.
Resolution: renderer clamps width/height and warns.
Deployed-runtime gap
Trigger: deployed run on 2026-04-29 observed email asset sizing PATCH 404; the probe locks this in until the gap is closed.
Resolution: the story expects the 404 until deployed sizing update exists.
Stable test attributes
Visibility teeth. Each attribute must be effectively visible when active.
email-assets-page | Page | Asset surface |
email-asset-uploader | Page | Upload |
email-asset-list | Page | Assets |
email-asset-sizing-controls | Inspector | Width/height |
email-asset-preview | Preview | Rendered asset |
email-asset-alt-warning | Preview | Missing alt |
email-asset-size-warning | Preview | Oversized |
email-asset-send-cta | Toolbar | Send |
email-asset-gap-panel | Page | Runtime gap |
Agent test plan
- email-assets-renders
- upload-email-asset
- patch-asset-sizing
- deployed-runtime-gap