Skip to content

Verification: Direct Email Send (Email Orders)

Traceability between requirements.md and the tests that verify them. Test design and conventions are in ui-implementation-analysis.md §5 (Jest + RTL

  • user-event, MSW, the 8 branch categories, getBy* over queryBy*, no render-only tests; Playwright page-object E2E in mock mode). Coverage thresholds: lines/statements 84, functions 81, branches 72.
RequirementVerifying test(s)TypeStatus
REQ-ES-001/002/003use-email-config-status (Operational + slug ⇒ enabled; Draft/Provisioning/Failed / query-failure ⇒ disabled); email-order-panel (full vs restricted layout)unitdone
REQ-ES-010/014/015email-order-panel + use-email-composer (edit ⇒ dirty; revert affordances; per-line + global notes; note heading appears only when filled)unitdone
REQ-ES-011email-order-panel (To empty, From/Cc self-seeded on open)unitdone
REQ-ES-012email-order-panel (Subject default Order for {supplier} — {MMM d, yyyy}, editable)unitdone
REQ-ES-013email-order-panel send mapping + send/route (UI From ⇒ replyToEmail; empty ⇒ null)unitdone
REQ-ES-020/021email-order-panel (Body toggle: Compose / HTML / plain-text preview; Send preview-gated); send/route (format ⇒ htmlBody+sanitize vs textBody only)unitdone
REQ-ES-022/023configuration-proxy / job-proxy + send/route (EmailJobInput shape; X-Tenant-Id + idempotency key)unit (BFF)done
REQ-ES-024email-order-panel (success ⇒ onComplete accept + close; error ⇒ no accept; in-flight guard); E2E happy path (order accepted)unit + E2Edone
REQ-ES-030email-order-panel (Copy writes text/html + text/plain; always available)unitdone
REQ-ES-040validate-email-order (empty To; malformed addr; empty subject; CR/LF or control chars — incl. trailing CR/LF on the raw value)unitdone
REQ-ES-041compose-email-html (escapes < > & " via escape-html in every user field)unitdone
REQ-ES-042sanitize-email-html via sanitize-html (strips script/iframe/style/event-handlers/javascript:/data:/images; resists attribute quote-smuggling); send/route sanitizes-and-sendsunit (BFF)done
REQ-ES-043send/route / config-status/route (no recipient/body logging)unit (BFF)done
REQ-ES-050email-order-panel (format-named success toast; mapped error messages); E2E (validation-blocked send shows error, no network call)unit + E2Edone

Implemented in arda-frontend-app at e2e/specs/orders/email-order-direct-send.spec.ts (Playwright, mock mode; describe TC-ORD-EMAIL-DS).

ScenarioCoversStatus
Open Email composer → toggle enabled (MSW) → add To → preview → Send → success toast → panel closes → order acceptedREQ-ES-001, 010, 012, 020, 024, 050done
Toggle disabled (MSW directSendEnabled:false) → no Send; Copy works and acceptsREQ-ES-003, 030done
Clear To → Send → blocking error toast, no network callREQ-ES-040, 050done