@@ -748,12 +748,12 @@ func TestCustomNotificationMethod(t *testing.T) {
748
748
749
749
// GIVEN: a notification template which has a method explicitly set
750
750
var (
751
- template = notifications .TemplateWorkspaceDormant
751
+ template = notifications .TemplateWorkspaceDormant
752
752
defaultMethod = database .NotificationMethodSmtp
753
- customMethod = database .NotificationMethodWebhook
753
+ customMethod = database .NotificationMethodWebhook
754
754
)
755
755
out , err := db .UpdateNotificationTemplateMethodByID (ctx , database.UpdateNotificationTemplateMethodByIDParams {
756
- ID : template ,
756
+ ID : template ,
757
757
Method : database.NullNotificationMethod {NotificationMethod : customMethod , Valid : true },
758
758
})
759
759
require .NoError (t , err )
@@ -762,8 +762,8 @@ func TestCustomNotificationMethod(t *testing.T) {
762
762
// GIVEN: a manager configured with multiple dispatch methods
763
763
cfg := defaultNotificationsConfig (defaultMethod )
764
764
cfg .SMTP = codersdk.NotificationsEmailConfig {
765
- From : "danny@coder.com" ,
766
- Hello : "localhost" ,
765
+ From : "danny@coder.com" ,
766
+ Hello : "localhost" ,
767
767
Smarthost : serpent.HostPort {Host : "localhost" , Port : fmt .Sprintf ("%d" , mockSMTPSrv .PortNumber ())},
768
768
}
769
769
cfg .Webhook = codersdk.NotificationsWebhookConfig {
@@ -782,6 +782,7 @@ func TestCustomNotificationMethod(t *testing.T) {
782
782
// WHEN: a notification of that template is enqueued, it should be delivered with the configured method - not the default.
783
783
user := createSampleUser (t , db )
784
784
msgID , err := enq .Enqueue (ctx , user .ID , template , map [string ]string {}, "test" )
785
+ require .NoError (t , err )
785
786
786
787
// THEN: the notification should be received by the custom dispatch method
787
788
mgr .Run (ctx )
0 commit comments