(t *testing.T)
| 100 | } |
| 101 | |
| 102 | func TestBuildPendingApprovalEvent(t *testing.T) { |
| 103 | a := &API{} |
| 104 | agent := &identity.AgentIdentity{ID: "bot@x.example.com", UserID: "u_1"} |
| 105 | expiry := time.Now().Add(1 * time.Hour) |
| 106 | msg := &identity.Message{ID: "pend_1", ApprovalExpiresAt: &expiry} |
| 107 | req := outbound.SendRequest{To: []string{"alice@example.com"}, Subject: "review me"} |
| 108 | ev := a.buildPendingApprovalEvent(agent, msg, req, "send") |
| 109 | if ev.Type != webhookpub.EventEmailPendingReview { |
| 110 | t.Errorf("Type = %q, want email.pending_review", ev.Type) |
| 111 | } |
| 112 | if ev.MessageID != "pend_1" { |
| 113 | t.Errorf("MessageID = %q, want pend_1", ev.MessageID) |
| 114 | } |
| 115 | if ev.UserID != "u_1" { |
| 116 | t.Errorf("UserID = %q", ev.UserID) |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | func TestBuildApprovedEvent(t *testing.T) { |
| 121 | a := &API{} |
nothing calls this directly
no test coverage detected