diff --git a/extension/notification/notification_test.go b/extension/notification/notification_test.go index 8423838f..ee6722b6 100644 --- a/extension/notification/notification_test.go +++ b/extension/notification/notification_test.go @@ -127,3 +127,38 @@ func TestSendLevelNotificationB(t *testing.T) { t.Errorf("unexpected level: %s", fs.sent.Level) } } + +func TestSendLevelNotificationC(t *testing.T) { + sndr := New(context.Background()) + + sndr.Configure(&Config{ + Level: types.LevelDebug, + Attempts: 1, + }) + + fs := &fakeSender{ + shouldConfigure: true, + shouldError: nil, + } + + RegisterSender("fakeSender", fs) + defer sndr.UnregisterSender("fakeSender") + + err := sndr.Send(types.EventNotification{ + Level: types.LevelDebug, + Type: types.NotificationPreDeploymentUpdate, + Message: "foo", + }) + + if err != nil { + t.Errorf("unexpected error: %s", err) + } + + if fs.sent.Message != "foo" { + t.Errorf("unexpected notification message: %s", fs.sent.Message) + } + + if fs.sent.Level != types.LevelDebug { + t.Errorf("unexpected level: %s", fs.sent.Level) + } +}