Skip to content

Commit c2b5c68

Browse files
matifalijohnstcn
andauthored
Apply suggestions from code review
Co-authored-by: Cian Johnston <cian@coder.com>
1 parent 4eadcf7 commit c2b5c68

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

cli/templatepush_test.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,10 @@ func TestTemplatePush(t *testing.T) {
194194

195195
t.Run("PushTemplateWithCreate", func(t *testing.T) {
196196
t.Parallel()
197+
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitMedium)
198+
t.Cleanup(cancel)
197199
client := coderdtest.New(t, &coderdtest.Options{IncludeProvisionerDaemon: true})
198200
user := coderdtest.CreateFirstUser(t, client)
199-
version := coderdtest.CreateTemplateVersion(t, client, user.OrganizationID, nil)
200-
_ = coderdtest.AwaitTemplateVersionJob(t, client, version.ID)
201201

202202
source := clitest.CreateTemplateVersionSource(t, &echo.Responses{
203203
Parse: echo.ParseComplete,
@@ -215,13 +215,19 @@ func TestTemplatePush(t *testing.T) {
215215
write string
216216
}{
217217
{match: "Upload", write: "yes"},
218+
{match: "Creating a new template"},
219+
218220
}
219221
for _, m := range matches {
220222
pty.ExpectMatch(m.match)
221223
if len(m.write) > 0 {
222224
pty.WriteLine(m.write)
223225
}
224-
}
226+
// Assert that the template was created.
227+
template, err := client.TemplateByName(ctx, user.OrganizationID, "example")
228+
require.NoError(t, err)
229+
require.NotNil(t, template.ID)
230+
}
225231
})
226232

227233
t.Run("UseWorkingDir", func(t *testing.T) {

0 commit comments

Comments
 (0)