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

Function TestNotifierBuildsAbsoluteURLs

internal/hitlnotify/notifier_test.go:180–194  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

178}
179
180func TestNotifierBuildsAbsoluteURLs(t *testing.T) {
181 n, store, _, smtpDone := newNotifier(t)
182 agent, msg := setupPendingMessage(t, store, "abs-url")
183
184 if err := n.NotifyPendingApproval(context.Background(), msg, agent); err != nil {
185 t.Fatal(err)
186 }
187 data := smtpDone()[0].Data
188 if !strings.Contains(data, publicURL+"/v1/approve?t=") {
189 t.Errorf("approve URL should be absolute under %q, got:\n%s", publicURL, data)
190 }
191 if !strings.Contains(data, publicURL+"/dashboard/pending/") {
192 t.Errorf("dashboard URL should be absolute under %q", publicURL)
193 }
194}
195
196func TestNotifierRejectsMessageWithNilApprovalExpiresAt(t *testing.T) {
197 n, store, _, smtpDone := newNotifier(t)

Callers

nothing calls this directly

Calls 3

newNotifierFunction · 0.85
setupPendingMessageFunction · 0.85
NotifyPendingApprovalMethod · 0.80

Tested by

no test coverage detected