@@ -149,6 +149,37 @@ func TestPatchGroup(t *testing.T) {
149
149
require .Equal (t , 20 , group .QuotaAllowance )
150
150
})
151
151
152
+ t .Run ("DisplayNameUnchanged" , func (t * testing.T ) {
153
+ t .Parallel ()
154
+
155
+ client , user := coderdenttest .New (t , & coderdenttest.Options {LicenseOptions : & coderdenttest.LicenseOptions {
156
+ Features : license.Features {
157
+ codersdk .FeatureTemplateRBAC : 1 ,
158
+ },
159
+ }})
160
+ const displayName = "foobar"
161
+ ctx := testutil .Context (t , testutil .WaitLong )
162
+ group , err := client .CreateGroup (ctx , user .OrganizationID , codersdk.CreateGroupRequest {
163
+ Name : "hi" ,
164
+ AvatarURL : "https://example.com" ,
165
+ QuotaAllowance : 10 ,
166
+ DisplayName : displayName ,
167
+ })
168
+ require .NoError (t , err )
169
+ require .Equal (t , 10 , group .QuotaAllowance )
170
+
171
+ group , err = client .PatchGroup (ctx , group .ID , codersdk.PatchGroupRequest {
172
+ Name : "bye" ,
173
+ AvatarURL : ptr .Ref ("https://google.com" ),
174
+ QuotaAllowance : ptr .Ref (20 ),
175
+ })
176
+ require .NoError (t , err )
177
+ require .Equal (t , displayName , group .DisplayName )
178
+ require .Equal (t , "bye" , group .Name )
179
+ require .Equal (t , "https://google.com" , group .AvatarURL )
180
+ require .Equal (t , 20 , group .QuotaAllowance )
181
+ })
182
+
152
183
// The FE sends a request from the edit page where the old name == new name.
153
184
// This should pass since it's not really an error to update a group name
154
185
// to itself.
0 commit comments