Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 31007a7

Browse files
committed
add tests for endpoint
1 parent 8e8b451 commit 31007a7

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

coderd/provisionerjobs_test.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,25 @@ func TestProvisionerJobs(t *testing.T) {
6363
TemplateVersionID: version.ID,
6464
})
6565

66+
t.Run("Single", func(t *testing.T) {
67+
t.Parallel()
68+
t.Run("OK", func(t *testing.T) {
69+
t.Parallel()
70+
ctx := testutil.Context(t, testutil.WaitMedium)
71+
// Note this calls the single job endpoint.
72+
job2, err := templateAdminClient.OrganizationProvisionerJob(ctx, owner.OrganizationID, job.ID)
73+
require.NoError(t, err)
74+
require.Equal(t, job.ID, job2.ID)
75+
})
76+
t.Run("Missing", func(t *testing.T) {
77+
t.Parallel()
78+
ctx := testutil.Context(t, testutil.WaitMedium)
79+
// Note this calls the single job endpoint.
80+
_, err := templateAdminClient.OrganizationProvisionerJob(ctx, owner.OrganizationID, uuid.New())
81+
require.Error(t, err)
82+
})
83+
})
84+
6685
t.Run("All", func(t *testing.T) {
6786
t.Parallel()
6887
ctx := testutil.Context(t, testutil.WaitMedium)

0 commit comments

Comments
 (0)