@@ -25,13 +25,15 @@ func TestTemplateEdit(t *testing.T) {
25
25
_ = coderdtest .AwaitTemplateVersionJob (t , client , version .ID )
26
26
template := coderdtest .CreateTemplate (t , client , user .OrganizationID , version .ID , func (ctr * codersdk.CreateTemplateRequest ) {
27
27
ctr .Description = "original description"
28
+ ctr .Icon = "/icons/default-icon.png"
28
29
ctr .MaxTTLMillis = ptr .Ref (24 * time .Hour .Milliseconds ())
29
30
ctr .MinAutostartIntervalMillis = ptr .Ref (time .Hour .Milliseconds ())
30
31
})
31
32
32
33
// Test the cli command.
33
34
name := "new-template-name"
34
35
desc := "lorem ipsum dolor sit amet et cetera"
36
+ icon := "/icons/new-icon.png"
35
37
maxTTL := 12 * time .Hour
36
38
minAutostartInterval := time .Minute
37
39
cmdArgs := []string {
@@ -40,6 +42,7 @@ func TestTemplateEdit(t *testing.T) {
40
42
template .Name ,
41
43
"--name" , name ,
42
44
"--description" , desc ,
45
+ "--icon" , icon ,
43
46
"--max-ttl" , maxTTL .String (),
44
47
"--min-autostart-interval" , minAutostartInterval .String (),
45
48
}
@@ -55,6 +58,7 @@ func TestTemplateEdit(t *testing.T) {
55
58
require .NoError (t , err )
56
59
assert .Equal (t , name , updated .Name )
57
60
assert .Equal (t , desc , updated .Description )
61
+ assert .Equal (t , desc , updated .Icon )
58
62
assert .Equal (t , maxTTL .Milliseconds (), updated .MaxTTLMillis )
59
63
assert .Equal (t , minAutostartInterval .Milliseconds (), updated .MinAutostartIntervalMillis )
60
64
})
@@ -67,6 +71,7 @@ func TestTemplateEdit(t *testing.T) {
67
71
_ = coderdtest .AwaitTemplateVersionJob (t , client , version .ID )
68
72
template := coderdtest .CreateTemplate (t , client , user .OrganizationID , version .ID , func (ctr * codersdk.CreateTemplateRequest ) {
69
73
ctr .Description = "original description"
74
+ ctr .Icon = "/icons/default-icon.png"
70
75
ctr .MaxTTLMillis = ptr .Ref (24 * time .Hour .Milliseconds ())
71
76
ctr .MinAutostartIntervalMillis = ptr .Ref (time .Hour .Milliseconds ())
72
77
})
@@ -78,6 +83,7 @@ func TestTemplateEdit(t *testing.T) {
78
83
template .Name ,
79
84
"--name" , template .Name ,
80
85
"--description" , template .Description ,
86
+ "--icon" , template .Icon ,
81
87
"--max-ttl" , (time .Duration (template .MaxTTLMillis ) * time .Millisecond ).String (),
82
88
"--min-autostart-interval" , (time .Duration (template .MinAutostartIntervalMillis ) * time .Millisecond ).String (),
83
89
}
@@ -93,6 +99,7 @@ func TestTemplateEdit(t *testing.T) {
93
99
require .NoError (t , err )
94
100
assert .Equal (t , template .Name , updated .Name )
95
101
assert .Equal (t , template .Description , updated .Description )
102
+ assert .Equal (t , template .Icon , updated .Icon )
96
103
assert .Equal (t , template .MaxTTLMillis , updated .MaxTTLMillis )
97
104
assert .Equal (t , template .MinAutostartIntervalMillis , updated .MinAutostartIntervalMillis )
98
105
})
0 commit comments