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

Function TestBuildRejectedEvent

internal/agent/webhooks_events_test.go:148–162  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

146}
147
148func TestBuildRejectedEvent(t *testing.T) {
149 a := &API{}
150 rejected := &identity.Message{ID: "msg_r", AgentID: "bot@x.example.com", Type: "send"}
151 ev := a.buildRejectedEvent("u_reviewer", rejected, "off-policy")
152 if ev.Type != webhookpub.EventEmailReviewRejected {
153 t.Errorf("Type = %q", ev.Type)
154 }
155 if ev.MessageID != "msg_r" {
156 t.Errorf("MessageID = %q", ev.MessageID)
157 }
158 data := ev.Data.(map[string]interface{})
159 if data["rejection_reason"] != "off-policy" {
160 t.Errorf("rejection_reason = %v", data["rejection_reason"])
161 }
162}
163
164func TestEmitBlockedOutbound(t *testing.T) {
165 fp := &fakePublisher{}

Callers

nothing calls this directly

Calls 1

buildRejectedEventMethod · 0.95

Tested by

no test coverage detected