Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite4103c3

Browse files
authored
feat: allow admins to modify notification template delivery method (#14116)
1 parentc744d33 commite4103c3

24 files changed

+2211
-150
lines changed

‎cli/notifications_test.go

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ import (
1616
"github.com/coder/coder/v2/testutil"
1717
)
1818

19+
funccreateOpts(t*testing.T)*coderdtest.Options {
20+
t.Helper()
21+
22+
dt:=coderdtest.DeploymentValues(t)
23+
dt.Experiments= []string{string(codersdk.ExperimentNotifications)}
24+
return&coderdtest.Options{
25+
DeploymentValues:dt,
26+
}
27+
}
28+
1929
funcTestNotifications(t*testing.T) {
2030
t.Parallel()
2131

@@ -42,7 +52,7 @@ func TestNotifications(t *testing.T) {
4252
t.Parallel()
4353

4454
// given
45-
ownerClient,db:=coderdtest.NewWithDatabase(t,nil)
55+
ownerClient,db:=coderdtest.NewWithDatabase(t,createOpts(t))
4656
_=coderdtest.CreateFirstUser(t,ownerClient)
4757

4858
// when
@@ -72,7 +82,7 @@ func TestPauseNotifications_RegularUser(t *testing.T) {
7282
t.Parallel()
7383

7484
// given
75-
ownerClient,db:=coderdtest.NewWithDatabase(t,nil)
85+
ownerClient,db:=coderdtest.NewWithDatabase(t,createOpts(t))
7686
owner:=coderdtest.CreateFirstUser(t,ownerClient)
7787
anotherClient,_:=coderdtest.CreateAnotherUser(t,ownerClient,owner.OrganizationID)
7888

@@ -87,7 +97,7 @@ func TestPauseNotifications_RegularUser(t *testing.T) {
8797
require.Error(t,err)
8898
require.ErrorAsf(t,err,&sdkError,"error should be of type *codersdk.Error")
8999
assert.Equal(t,http.StatusForbidden,sdkError.StatusCode())
90-
assert.Contains(t,sdkError.Message,"Insufficient permissions to update notifications settings.")
100+
assert.Contains(t,sdkError.Message,"Forbidden.")
91101

92102
// then
93103
ctx,cancel:=context.WithTimeout(context.Background(),testutil.WaitShort)

‎coderd/apidoc/docs.go

Lines changed: 247 additions & 2 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp