Verification: Direct Email Send (Email Orders)
Purpose
Section titled “Purpose”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*overqueryBy*, no render-only tests; Playwright page-object E2E in mock mode). Coverage thresholds: lines/statements 84, functions 81, branches 72.
Traceability
Section titled “Traceability”| Requirement | Verifying test(s) | Type | Status |
|---|---|---|---|
| REQ-ES-001/002/003 | use-email-config-status (Operational + slug ⇒ enabled; Draft/Provisioning/Failed / query-failure ⇒ disabled); email-order-panel (full vs restricted layout) | unit | done |
| REQ-ES-010/014/015 | email-order-panel + use-email-composer (edit ⇒ dirty; revert affordances; per-line + global notes; note heading appears only when filled) | unit | done |
| REQ-ES-011 | email-order-panel (To empty, From/Cc self-seeded on open) | unit | done |
| REQ-ES-012 | email-order-panel (Subject default Order for {supplier} — {MMM d, yyyy}, editable) | unit | done |
| REQ-ES-013 | email-order-panel send mapping + send/route (UI From ⇒ replyToEmail; empty ⇒ null) | unit | done |
| REQ-ES-020/021 | email-order-panel (Body toggle: Compose / HTML / plain-text preview; Send preview-gated); send/route (format ⇒ htmlBody+sanitize vs textBody only) | unit | done |
| REQ-ES-022/023 | configuration-proxy / job-proxy + send/route (EmailJobInput shape; X-Tenant-Id + idempotency key) | unit (BFF) | done |
| REQ-ES-024 | email-order-panel (success ⇒ onComplete accept + close; error ⇒ no accept; in-flight guard); E2E happy path (order accepted) | unit + E2E | done |
| REQ-ES-030 | email-order-panel (Copy writes text/html + text/plain; always available) | unit | done |
| REQ-ES-040 | validate-email-order (empty To; malformed addr; empty subject; CR/LF or control chars — incl. trailing CR/LF on the raw value) | unit | done |
| REQ-ES-041 | compose-email-html (escapes < > & " via escape-html in every user field) | unit | done |
| REQ-ES-042 | sanitize-email-html via sanitize-html (strips script/iframe/style/event-handlers/javascript:/data:/images; resists attribute quote-smuggling); send/route sanitizes-and-sends | unit (BFF) | done |
| REQ-ES-043 | send/route / config-status/route (no recipient/body logging) | unit (BFF) | done |
| REQ-ES-050 | email-order-panel (format-named success toast; mapped error messages); E2E (validation-blocked send shows error, no network call) | unit + E2E | done |
E2E scenarios
Section titled “E2E scenarios”Implemented in arda-frontend-app at e2e/specs/orders/email-order-direct-send.spec.ts
(Playwright, mock mode; describe TC-ORD-EMAIL-DS).
| Scenario | Covers | Status |
|---|---|---|
| Open Email composer → toggle enabled (MSW) → add To → preview → Send → success toast → panel closes → order accepted | REQ-ES-001, 010, 012, 020, 024, 050 | done |
Toggle disabled (MSW directSendEnabled:false) → no Send; Copy works and accepts | REQ-ES-003, 030 | done |
| Clear To → Send → blocking error toast, no network call | REQ-ES-040, 050 | done |
Copyright: © Arda Systems 2025-2026, All rights reserved