@@ -115,6 +115,36 @@ func TestWorkspace(t *testing.T) {
115
115
})
116
116
require .Error (t ,err ,"workspace rename should have failed" )
117
117
})
118
+
119
+ t .Run ("TemplateProperties" ,func (t * testing.T ) {
120
+ t .Parallel ()
121
+ client := coderdtest .New (t ,& coderdtest.Options {IncludeProvisionerDaemon :true })
122
+ user := coderdtest .CreateFirstUser (t ,client )
123
+ version := coderdtest .CreateTemplateVersion (t ,client ,user .OrganizationID ,nil )
124
+ coderdtest .AwaitTemplateVersionJob (t ,client ,version .ID )
125
+
126
+ const templateIcon = "/img/icon.svg"
127
+ const templateDisplayName = "This is template"
128
+ template := coderdtest .CreateTemplate (t ,client ,user .OrganizationID ,version .ID ,func (ctr * codersdk.CreateTemplateRequest ) {
129
+ ctr .Icon = templateIcon
130
+ ctr .DisplayName = templateDisplayName
131
+ })
132
+ require .NotEmpty (t ,template .Name )
133
+ require .NotEmpty (t ,template .DisplayName )
134
+ require .NotEmpty (t ,template .Icon )
135
+ workspace := coderdtest .CreateWorkspace (t ,client ,user .OrganizationID ,template .ID )
136
+
137
+ ctx ,cancel := context .WithTimeout (context .Background (),testutil .WaitLong )
138
+ defer cancel ()
139
+
140
+ ws ,err := client .Workspace (ctx ,workspace .ID )
141
+ require .NoError (t ,err )
142
+ assert .Equal (t ,user .UserID ,ws .LatestBuild .InitiatorID )
143
+ assert .Equal (t ,codersdk .BuildReasonInitiator ,ws .LatestBuild .Reason )
144
+ assert .Equal (t ,template .Name ,ws .TemplateName )
145
+ assert .Equal (t ,templateIcon ,ws .TemplateIcon )
146
+ assert .Equal (t ,templateDisplayName ,ws .TemplateDisplayName )
147
+ })
118
148
}
119
149
120
150
func TestAdminViewAllWorkspaces (t * testing.T ) {