Skip to content

Commit ec2bb2f

Browse files
committed
ErrorDismissed
1 parent 1bf4fbf commit ec2bb2f

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

coderd/healthcheck/workspaceproxy_test.go

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,22 @@ func TestWorkspaceProxies(t *testing.T) {
191191
}
192192
}
193193

194+
func TestWorkspaceProxy_ErrorDismissed(t *testing.T) {
195+
t.Parallel()
196+
197+
var report healthcheck.WorkspaceProxyReport
198+
report.Run(context.Background(), &healthcheck.WorkspaceProxyReportOptions{
199+
WorkspaceProxiesFetchUpdater: &fakeWorkspaceProxyFetchUpdater{
200+
fetchFunc: fakeFetchWorkspaceProxiesErr(assert.AnError),
201+
updateFunc: fakeUpdateProxyHealth(assert.AnError),
202+
},
203+
Dismissed: true,
204+
})
205+
206+
assert.True(t, report.Dismissed)
207+
assert.Equal(t, health.SeverityWarning, report.Severity)
208+
}
209+
194210
// yet another implementation of the thing
195211
type fakeWorkspaceProxyFetchUpdater struct {
196212
fetchFunc func(context.Context) (codersdk.RegionsResponse[codersdk.WorkspaceProxy], error)
@@ -236,15 +252,3 @@ func fakeUpdateProxyHealth(err error) func(context.Context) error {
236252
return err
237253
}
238254
}
239-
240-
func TestWorkspaceProxy_Dismissed(t *testing.T) {
241-
t.Parallel()
242-
243-
var report healthcheck.WorkspaceProxyReport
244-
report.Run(context.Background(), &healthcheck.WorkspaceProxyReportOptions{
245-
Dismissed: true,
246-
})
247-
248-
assert.True(t, report.Dismissed)
249-
assert.Equal(t, health.SeverityOK, report.Severity)
250-
}

0 commit comments

Comments
 (0)