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

Function TestOutboundResponseFormat

internal/e2e/e2e_test.go:235–263  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

233}
234
235func TestOutboundResponseFormat(t *testing.T) {
236 t.Skip("requires an outbound SMTP relay configured in testutil.TestServer — tracked as test-infra work")
237 pool := testutil.TestDB(t)
238 receiver := testutil.WebhookReceiver(t)
239 ts := testutil.TestServer(t, pool)
240
241 _, apiKey, senderAgent := setupDomainAndAgent(t, ts, "agent@resp-a.example.com", "resp-a.example.com", "https://example.com/w", "cloud")
242 _, _, _ = setupDomainAndAgent(t, ts, "agent@resp-b.example.com", "resp-b.example.com", receiver.Server.URL, "cloud")
243
244 sendPayload := `{"to":["agent@resp-b.example.com"],"subject":"Test","body":"Hello"}`
245 req, _ := http.NewRequest("POST", ts.HTTPServer.URL+"/v1/agents/"+url.PathEscape(senderAgent.EmailAddress())+"/messages", bytes.NewBufferString(sendPayload))
246 req.Header.Set("Content-Type", "application/json")
247 req.Header.Set("Authorization", "Bearer "+apiKey.PlaintextKey)
248 resp, _ := http.DefaultClient.Do(req)
249 defer resp.Body.Close()
250
251 var body map[string]string
252 json.NewDecoder(resp.Body).Decode(&body)
253
254 if body["status"] != "sent" {
255 t.Errorf("status = %q, want sent", body["status"])
256 }
257 if body["message_id"] == "" {
258 t.Error("expected non-empty message_id")
259 }
260 if body["method"] != "smtp" {
261 t.Errorf("method = %q, want smtp", body["method"])
262 }
263}
264
265func TestPollMode_E2E(t *testing.T) {
266 // The reply portion of this test sends to a non-e2a recipient

Callers

nothing calls this directly

Calls 7

TestDBFunction · 0.92
WebhookReceiverFunction · 0.92
TestServerFunction · 0.92
setupDomainAndAgentFunction · 0.85
EmailAddressMethod · 0.80
CloseMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected