Held-draft (pending_approval) messages expose body_text/html via Body, the second representation the unified read serves (sent/inbound use raw_message).
(t *testing.T)
| 86 | // Held-draft (pending_approval) messages expose body_text/html via Body, the |
| 87 | // second representation the unified read serves (sent/inbound use raw_message). |
| 88 | func TestMessageViewHeldDraftBody(t *testing.T) { |
| 89 | draft := messageViewFromIdentity(&identity.Message{ |
| 90 | ID: "msg_d", Direction: "outbound", Status: "pending_review", |
| 91 | BodyText: "draft text", BodyHTML: "<p>draft</p>", |
| 92 | }) |
| 93 | if draft.Body == nil || draft.Body.Text != "draft text" || draft.Body.HTML != "<p>draft</p>" { |
| 94 | t.Fatalf("held draft should expose body, got %+v", draft.Body) |
| 95 | } |
| 96 | // A sent/inbound message (no body columns) has no Body. |
| 97 | sent := messageViewFromIdentity(&identity.Message{ID: "msg_s", Direction: "inbound", RawMessage: []byte("From: a@x\r\n\r\nhi")}) |
| 98 | if sent.Body != nil { |
| 99 | t.Fatalf("inbound/sent must not carry a draft Body, got %+v", sent.Body) |
| 100 | } |
| 101 | } |
nothing calls this directly
no test coverage detected