Skip to content

feat(cli): pause notifications #13873

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jul 11, 2024
Merged
Prev Previous commit
Next Next commit
check error message
  • Loading branch information
mtojek committed Jul 11, 2024
commit d907ef24cb8eacfcabc8cd97d508fcbf337b18d0
4 changes: 3 additions & 1 deletion cli/notifications_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"net/http"
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/coder/coder/v2/cli/clitest"
Expand Down Expand Up @@ -61,7 +62,8 @@ func TestPauseNotifications_RegularUser(t *testing.T) {
var sdkError *codersdk.Error
require.Error(t, err)
require.ErrorAsf(t, err, &sdkError, "error should be of type *codersdk.Error")
require.Equal(t, http.StatusForbidden, sdkError.StatusCode())
assert.Equal(t, http.StatusForbidden, sdkError.StatusCode())
assert.Contains(t, sdkError.Message, "Insufficient permissions to update notifications settings.")

// then
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort)
Expand Down
Loading