mirror of
https://github.com/coder/coder.git
synced 2025-07-18 14:17:22 +00:00
chore: disallow inbox as default method (#17093)
Disallow setting `inbox` as the default notifications method.
This commit is contained in:
@ -1856,6 +1856,18 @@ func TestNotificationDuplicates(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
func TestNotificationMethodCannotDefaultToInbox(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
store, _ := dbtestutil.NewDB(t)
|
||||
logger := testutil.Logger(t)
|
||||
|
||||
cfg := defaultNotificationsConfig(database.NotificationMethodInbox)
|
||||
|
||||
_, err := notifications.NewStoreEnqueuer(cfg, store, defaultHelpers(), logger.Named("enqueuer"), quartz.NewMock(t))
|
||||
require.ErrorIs(t, err, notifications.InvalidDefaultNotificationMethodError{Method: string(database.NotificationMethodInbox)})
|
||||
}
|
||||
|
||||
func TestNotificationTargetMatrix(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
|
Reference in New Issue
Block a user