MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / TestComposeMessageCCOnlyOmitsToHeader

Function TestComposeMessageCCOnlyOmitsToHeader

internal/outbound/compose_test.go:168–193  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

166}
167
168func TestComposeMessageCCOnlyOmitsToHeader(t *testing.T) {
169 raw, err := ComposeMessage(
170 "from@test.com",
171 nil,
172 []string{"carol@gmail.com"},
173 "Hello",
174 "Body",
175 "text/plain",
176 "",
177 nil,
178 "test.dev",
179 "",
180 "",
181 )
182 if err != nil {
183 t.Fatalf("ComposeMessage failed: %v", err)
184 }
185
186 msg, _ := mail.ReadMessage(strings.NewReader(string(raw)))
187 if got := msg.Header.Get("To"); got != "" {
188 t.Errorf("To = %q, want empty (CC-only)", got)
189 }
190 if got := msg.Header.Get("Cc"); got != "carol@gmail.com" {
191 t.Errorf("Cc = %q, want carol@gmail.com", got)
192 }
193}
194
195func TestComposeMessageNoBccHeader(t *testing.T) {
196 // BCC should never appear in composed message headers

Callers

nothing calls this directly

Calls 2

ComposeMessageFunction · 0.85
GetMethod · 0.65

Tested by

no test coverage detected