Skip to content

Commit da6775f

Browse files
committed
remove test for not modified
1 parent c90ff21 commit da6775f

File tree

2 files changed

+1
-23
lines changed

2 files changed

+1
-23
lines changed

coderd/notifications_test.go

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -60,24 +60,4 @@ func TestUpdateNotificationsSettings(t *testing.T) {
6060
require.NoError(t, err)
6161
require.Equal(t, expected, actual)
6262
})
63-
64-
t.Run("Settings not modified", func(t *testing.T) {
65-
t.Parallel()
66-
67-
client := coderdtest.New(t, nil)
68-
_ = coderdtest.CreateFirstUser(t, client)
69-
70-
ctx := testutil.Context(t, testutil.WaitShort)
71-
72-
// given
73-
expected := codersdk.NotificationsSettings{
74-
NotifierPaused: false,
75-
}
76-
err := client.PutNotificationsSettings(ctx, expected)
77-
require.NoError(t, err)
78-
79-
// then
80-
err = client.PutNotificationsSettings(ctx, expected)
81-
require.Error(t, err) // Error: notifications settings not modified
82-
})
8363
}

codersdk/notifications.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import (
44
"context"
55
"encoding/json"
66
"net/http"
7-
8-
"golang.org/x/xerrors"
97
)
108

119
type NotificationsSettings struct {
@@ -33,7 +31,7 @@ func (c *Client) PutNotificationsSettings(ctx context.Context, settings Notifica
3331
defer res.Body.Close()
3432

3533
if res.StatusCode == http.StatusNotModified {
36-
return xerrors.New("notifications settings not modified")
34+
return nil
3735
}
3836
if res.StatusCode != http.StatusOK {
3937
return ReadBodyAsError(res)

0 commit comments

Comments
 (0)