Skip to content

Commit f031b10

Browse files
committed
enttest options
1 parent 9d89950 commit f031b10

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

enterprise/coderd/coderdenttest/coderdenttest.go

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,15 @@ func NewWithAPI(t *testing.T, options *Options) (*codersdk.Client, io.Closer, *c
8282
}
8383

8484
type LicenseOptions struct {
85-
AccountType string
86-
AccountID string
87-
GraceAt time.Time
88-
ExpiresAt time.Time
89-
UserLimit int64
90-
AuditLog bool
91-
BrowserOnly bool
92-
SCIM bool
85+
AccountType string
86+
AccountID string
87+
GraceAt time.Time
88+
ExpiresAt time.Time
89+
UserLimit int64
90+
AuditLog bool
91+
BrowserOnly bool
92+
SCIM bool
93+
WorkspaceQuota bool
9394
}
9495

9596
// AddLicense generates a new license with the options provided and inserts it.
@@ -121,6 +122,10 @@ func GenerateLicense(t *testing.T, options LicenseOptions) string {
121122
if options.SCIM {
122123
scim = 1
123124
}
125+
workspaceQuota := int64(0)
126+
if options.WorkspaceQuota {
127+
workspaceQuota = 1
128+
}
124129

125130
c := &coderd.Claims{
126131
RegisteredClaims: jwt.RegisteredClaims{
@@ -134,10 +139,11 @@ func GenerateLicense(t *testing.T, options LicenseOptions) string {
134139
AccountID: options.AccountID,
135140
Version: coderd.CurrentVersion,
136141
Features: coderd.Features{
137-
UserLimit: options.UserLimit,
138-
AuditLog: auditLog,
139-
BrowserOnly: browserOnly,
140-
SCIM: scim,
142+
UserLimit: options.UserLimit,
143+
AuditLog: auditLog,
144+
BrowserOnly: browserOnly,
145+
SCIM: scim,
146+
WorkspaceQuota: workspaceQuota,
141147
},
142148
}
143149
tok := jwt.NewWithClaims(jwt.SigningMethodEdDSA, c)

0 commit comments

Comments
 (0)