File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -273,4 +273,29 @@ func TestCustomOrganizationRole(t *testing.T) {
273
273
_ , err = owner .PatchOrganizationRole (ctx , first .OrganizationID , userRole )
274
274
require .ErrorContains (t , err , "not allowed to assign user permissions" )
275
275
})
276
+
277
+ t .Run ("InvalidUUID" , func (t * testing.T ) {
278
+ t .Parallel ()
279
+ dv := coderdtest .DeploymentValues (t )
280
+ dv .Experiments = []string {string (codersdk .ExperimentCustomRoles )}
281
+ owner , first := coderdenttest .New (t , & coderdenttest.Options {
282
+ Options : & coderdtest.Options {
283
+ DeploymentValues : dv ,
284
+ },
285
+ LicenseOptions : & coderdenttest.LicenseOptions {
286
+ Features : license.Features {
287
+ codersdk .FeatureCustomRoles : 1 ,
288
+ },
289
+ },
290
+ })
291
+
292
+ ctx := testutil .Context (t , testutil .WaitMedium )
293
+
294
+ newRole := templateAdminCustom (first .OrganizationID )
295
+ newRole .OrganizationID = "0000" // This is not a valid uuid
296
+
297
+ //nolint:gocritic // owner is required for this
298
+ _ , err := owner .PatchOrganizationRole (ctx , first .OrganizationID , newRole )
299
+ require .ErrorContains (t , err , "Invalid request" )
300
+ })
276
301
}
You can’t perform that action at this time.
0 commit comments