@@ -89,7 +89,7 @@ func TestCustomOrganizationRole(t *testing.T) {
89
89
90
90
// Revoked licenses cannot modify/create custom roles, but they can
91
91
// use the existing roles.
92
- t .Run ("Revoked License " , func (t * testing.T ) {
92
+ t .Run ("RevokedLicense " , func (t * testing.T ) {
93
93
t .Parallel ()
94
94
dv := coderdtest .DeploymentValues (t )
95
95
dv .Experiments = []string {string (codersdk .ExperimentCustomRoles )}
@@ -208,4 +208,26 @@ func TestCustomOrganizationRole(t *testing.T) {
208
208
})
209
209
require .ErrorContains (t , err , "Validation" )
210
210
})
211
+
212
+ t .Run ("MismatchedOrganizations" , func (t * testing.T ) {
213
+ t .Parallel ()
214
+ dv := coderdtest .DeploymentValues (t )
215
+ dv .Experiments = []string {string (codersdk .ExperimentCustomRoles )}
216
+ owner , first := coderdenttest .New (t , & coderdenttest.Options {
217
+ Options : & coderdtest.Options {
218
+ DeploymentValues : dv ,
219
+ },
220
+ LicenseOptions : & coderdenttest.LicenseOptions {
221
+ Features : license.Features {
222
+ codersdk .FeatureCustomRoles : 1 ,
223
+ },
224
+ },
225
+ })
226
+
227
+ ctx := testutil .Context (t , testutil .WaitMedium )
228
+
229
+ //nolint:gocritic // owner is required for this
230
+ _ , err := owner .PatchOrganizationRole (ctx , first .OrganizationID , templateAdminCustom (uuid .New ()))
231
+ require .ErrorContains (t , err , "does not match" )
232
+ })
211
233
}
0 commit comments