(t *testing.T)
| 210 | } |
| 211 | |
| 212 | func 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 | |
| 227 | func TestNotifierNilSafe(t *testing.T) { |
| 228 | var n *hitlnotify.Notifier |
nothing calls this directly
no test coverage detected