MCPcopy Index your code
hub / github.com/coder/coder / TestModify

Function TestModify

coderd/entitlements/entitlements_test.go:15–28  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

13)
14
15func TestModify(t *testing.T) {
16 t.Parallel()
17
18 set := entitlements.New()
19 require.False(t, set.Enabled(codersdk.FeatureMultipleOrganizations))
20
21 set.Modify(func(entitlements *codersdk.Entitlements) {
22 entitlements.Features[codersdk.FeatureMultipleOrganizations] = codersdk.Feature{
23 Enabled: true,
24 Entitlement: codersdk.EntitlementEntitled,
25 }
26 })
27 require.True(t, set.Enabled(codersdk.FeatureMultipleOrganizations))
28}
29
30func TestAllowRefresh(t *testing.T) {
31 t.Parallel()

Callers

nothing calls this directly

Calls 3

NewFunction · 0.92
ModifyMethod · 0.80
EnabledMethod · 0.65

Tested by

no test coverage detected