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

Commit88b9796

Browse files
committed
Fix tests
Signed-off-by: Danny Kopping <danny@coder.com>
1 parentece6fff commit88b9796

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

‎cli/notifications_test.go

Lines changed: 11 additions & 1 deletion
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

‎coderd/notifications/notifications_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -799,8 +799,9 @@ func TestCustomNotificationMethod(t *testing.T) {
799799
require.NoError(t,err)
800800
require.EventuallyWithT(t,func(ct*assert.CollectT) {
801801
msgs:=mockSMTPSrv.MessagesAndPurge()
802-
assert.Len(ct,msgs,1)
803-
assert.Contains(ct,msgs[0].MsgRequest(),fmt.Sprintf("Message-Id: %s",msgID))
802+
ifassert.Len(ct,msgs,1) {
803+
assert.Contains(ct,msgs[0].MsgRequest(),fmt.Sprintf("Message-Id: %s",msgID))
804+
}
804805
},testutil.WaitLong,testutil.IntervalFast)
805806
}
806807

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp