@@ -48,25 +48,27 @@ func TestEntitlements(t *testing.T) {
48
48
AuditLogging : true ,
49
49
DontAddLicense : true ,
50
50
})
51
+ // Enable all features
52
+ features := make (license.Features )
53
+ for _ , feature := range codersdk .FeatureNames {
54
+ features [feature ] = 1
55
+ }
56
+ features [codersdk .FeatureUserLimit ] = 100
51
57
coderdenttest .AddLicense (t , client , coderdenttest.LicenseOptions {
52
- Features : license.Features {
53
- codersdk .FeatureUserLimit : 100 ,
54
- codersdk .FeatureAuditLog : 1 ,
55
- codersdk .FeatureTemplateRBAC : 1 ,
56
- codersdk .FeatureExternalProvisionerDaemons : 1 ,
57
- codersdk .FeatureAdvancedTemplateScheduling : 1 ,
58
- codersdk .FeatureWorkspaceProxy : 1 ,
59
- codersdk .FeatureUserRoleManagement : 1 ,
60
- },
61
- GraceAt : time .Now ().Add (59 * 24 * time .Hour ),
58
+ Features : features ,
59
+ GraceAt : time .Now ().Add (59 * 24 * time .Hour ),
62
60
})
63
61
res , err := client .Entitlements (context .Background ())
64
62
require .NoError (t , err )
65
63
assert .True (t , res .HasLicense )
66
64
ul := res .Features [codersdk .FeatureUserLimit ]
67
65
assert .Equal (t , codersdk .EntitlementEntitled , ul .Entitlement )
68
- assert .Equal (t , int64 (100 ), * ul .Limit )
69
- assert .Equal (t , int64 (1 ), * ul .Actual )
66
+ if assert .NotNil (t , ul .Limit ) {
67
+ assert .Equal (t , int64 (100 ), * ul .Limit )
68
+ }
69
+ if assert .NotNil (t , ul .Actual ) {
70
+ assert .Equal (t , int64 (1 ), * ul .Actual )
71
+ }
70
72
assert .True (t , ul .Enabled )
71
73
al := res .Features [codersdk .FeatureAuditLog ]
72
74
assert .Equal (t , codersdk .EntitlementEntitled , al .Entitlement )
0 commit comments