@@ -194,10 +194,10 @@ func TestTemplatePush(t *testing.T) {
194
194
195
195
t .Run ("PushTemplateWithCreate" , func (t * testing.T ) {
196
196
t .Parallel ()
197
+ ctx , cancel := context .WithTimeout (context .Background (), testutil .WaitMedium )
198
+ t .Cleanup (cancel )
197
199
client := coderdtest .New (t , & coderdtest.Options {IncludeProvisionerDaemon : true })
198
200
user := coderdtest .CreateFirstUser (t , client )
199
- version := coderdtest .CreateTemplateVersion (t , client , user .OrganizationID , nil )
200
- _ = coderdtest .AwaitTemplateVersionJob (t , client , version .ID )
201
201
202
202
source := clitest .CreateTemplateVersionSource (t , & echo.Responses {
203
203
Parse : echo .ParseComplete ,
@@ -215,13 +215,19 @@ func TestTemplatePush(t *testing.T) {
215
215
write string
216
216
}{
217
217
{match : "Upload" , write : "yes" },
218
+ {match : "Creating a new template" },
219
+
218
220
}
219
221
for _ , m := range matches {
220
222
pty .ExpectMatch (m .match )
221
223
if len (m .write ) > 0 {
222
224
pty .WriteLine (m .write )
223
225
}
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
+ }
225
231
})
226
232
227
233
t .Run ("UseWorkingDir" , func (t * testing.T ) {
0 commit comments