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

Function TestNotifierAsyncFireAndForget

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

Source from the content-addressed store, hash-verified

210}
211
212func TestNotifierAsyncFireAndForget(t *testing.T) {
213 n, store, _, smtpDone := newNotifier(t)
214 agent, msg := setupPendingMessage(t, store, "async")
215
216 n.NotifyPendingApprovalAsync(msg, agent)
217
218 // Fakesmtp closes the listener on the first smtpDone() call, so
219 // sleep once and then read the result in a single shot.
220 time.Sleep(500 * time.Millisecond)
221 msgs := smtpDone()
222 if len(msgs) != 1 {
223 t.Fatalf("async notification: got %d messages, want 1", len(msgs))
224 }
225}
226
227func TestNotifierNilSafe(t *testing.T) {
228 var n *hitlnotify.Notifier

Callers

nothing calls this directly

Calls 3

newNotifierFunction · 0.85
setupPendingMessageFunction · 0.85

Tested by

no test coverage detected