(t *testing.T)
| 146 | } |
| 147 | |
| 148 | func 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 | |
| 164 | func TestEmitBlockedOutbound(t *testing.T) { |
| 165 | fp := &fakePublisher{} |
nothing calls this directly
no test coverage detected