@@ -233,12 +233,14 @@ func TestPatchTemplateMeta(t *testing.T) {
233
233
version := coderdtest .CreateTemplateVersion (t , client , user .OrganizationID , nil )
234
234
template := coderdtest .CreateTemplate (t , client , user .OrganizationID , version .ID , func (ctr * codersdk.CreateTemplateRequest ) {
235
235
ctr .Description = "original description"
236
+ ctr .Icon = "/icons/original-icon.png"
236
237
ctr .MaxTTLMillis = ptr .Ref (24 * time .Hour .Milliseconds ())
237
238
ctr .MinAutostartIntervalMillis = ptr .Ref (time .Hour .Milliseconds ())
238
239
})
239
240
req := codersdk.UpdateTemplateMeta {
240
241
Name : "new-template-name" ,
241
242
Description : "lorem ipsum dolor sit amet et cetera" ,
243
+ Icon : "/icons/new-icon.png" ,
242
244
MaxTTLMillis : 12 * time .Hour .Milliseconds (),
243
245
MinAutostartIntervalMillis : time .Minute .Milliseconds (),
244
246
}
@@ -254,6 +256,7 @@ func TestPatchTemplateMeta(t *testing.T) {
254
256
assert .Greater (t , updated .UpdatedAt , template .UpdatedAt )
255
257
assert .Equal (t , req .Name , updated .Name )
256
258
assert .Equal (t , req .Description , updated .Description )
259
+ assert .Equal (t , req .Icon , updated .Icon )
257
260
assert .Equal (t , req .MaxTTLMillis , updated .MaxTTLMillis )
258
261
assert .Equal (t , req .MinAutostartIntervalMillis , updated .MinAutostartIntervalMillis )
259
262
@@ -263,6 +266,7 @@ func TestPatchTemplateMeta(t *testing.T) {
263
266
assert .Greater (t , updated .UpdatedAt , template .UpdatedAt )
264
267
assert .Equal (t , req .Name , updated .Name )
265
268
assert .Equal (t , req .Description , updated .Description )
269
+ assert .Equal (t , req .Icon , updated .Icon )
266
270
assert .Equal (t , req .MaxTTLMillis , updated .MaxTTLMillis )
267
271
assert .Equal (t , req .MinAutostartIntervalMillis , updated .MinAutostartIntervalMillis )
268
272
})
@@ -275,6 +279,7 @@ func TestPatchTemplateMeta(t *testing.T) {
275
279
version := coderdtest .CreateTemplateVersion (t , client , user .OrganizationID , nil )
276
280
template := coderdtest .CreateTemplate (t , client , user .OrganizationID , version .ID , func (ctr * codersdk.CreateTemplateRequest ) {
277
281
ctr .Description = "original description"
282
+ ctr .Icon = "/icons/original-icon.png"
278
283
ctr .MaxTTLMillis = ptr .Ref (24 * time .Hour .Milliseconds ())
279
284
ctr .MinAutostartIntervalMillis = ptr .Ref (time .Hour .Milliseconds ())
280
285
})
@@ -285,6 +290,7 @@ func TestPatchTemplateMeta(t *testing.T) {
285
290
req := codersdk.UpdateTemplateMeta {
286
291
Name : template .Name ,
287
292
Description : template .Description ,
293
+ Icon : template .Icon ,
288
294
MaxTTLMillis : template .MaxTTLMillis ,
289
295
MinAutostartIntervalMillis : template .MinAutostartIntervalMillis ,
290
296
}
@@ -295,6 +301,7 @@ func TestPatchTemplateMeta(t *testing.T) {
295
301
assert .Equal (t , updated .UpdatedAt , template .UpdatedAt )
296
302
assert .Equal (t , template .Name , updated .Name )
297
303
assert .Equal (t , template .Description , updated .Description )
304
+ assert .Equal (t , template .Icon , updated .Icon )
298
305
assert .Equal (t , template .MaxTTLMillis , updated .MaxTTLMillis )
299
306
assert .Equal (t , template .MinAutostartIntervalMillis , updated .MinAutostartIntervalMillis )
300
307
})
@@ -331,6 +338,7 @@ func TestPatchTemplateMeta(t *testing.T) {
331
338
assert .WithinDuration (t , template .UpdatedAt , updated .UpdatedAt , time .Minute )
332
339
assert .Equal (t , template .Name , updated .Name )
333
340
assert .Equal (t , template .Description , updated .Description )
341
+ assert .Equal (t , template .Icon , updated .Icon )
334
342
assert .Equal (t , template .MaxTTLMillis , updated .MaxTTLMillis )
335
343
assert .Equal (t , template .MinAutostartIntervalMillis , updated .MinAutostartIntervalMillis )
336
344
})
0 commit comments