Skip to content

Commit 30c586c

Browse files
committed
Fix test
1 parent 4300414 commit 30c586c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

coderd/templateversions_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ func TestTemplateVersionByOrganizationAndName(t *testing.T) {
966966

967967
func TestPreviousTemplateVersion(t *testing.T) {
968968
t.Parallel()
969-
t.Run("Not found", func(t *testing.T) {
969+
t.Run("Previous version not found", func(t *testing.T) {
970970
t.Parallel()
971971
client := coderdtest.New(t, nil)
972972
user := coderdtest.CreateFirstUser(t, client)
@@ -981,12 +981,13 @@ func TestPreviousTemplateVersion(t *testing.T) {
981981
require.Equal(t, http.StatusNotFound, apiErr.StatusCode())
982982
})
983983

984-
t.Run("Found", func(t *testing.T) {
984+
t.Run("Previous version found", func(t *testing.T) {
985985
t.Parallel()
986986
client := coderdtest.New(t, nil)
987987
user := coderdtest.CreateFirstUser(t, client)
988988
previousVersion := coderdtest.CreateTemplateVersion(t, client, user.OrganizationID, nil)
989-
latestVersion := coderdtest.UpdateTemplateVersion(t, client, user.OrganizationID, nil, *previousVersion.TemplateID)
989+
template := coderdtest.CreateTemplate(t, client, user.OrganizationID, previousVersion.ID)
990+
latestVersion := coderdtest.UpdateTemplateVersion(t, client, user.OrganizationID, nil, template.ID)
990991

991992
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
992993
defer cancel()

0 commit comments

Comments
 (0)