Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 67f69d6

Browse files
committed
test OrganizationSyncEnabled
1 parent 61ff880 commit 67f69d6

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

coderd/telemetry/telemetry_test.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ func TestTelemetry(t *testing.T) {
106106

107107
_ = dbgen.WorkspaceModule(t, db, database.WorkspaceModule{})
108108

109-
_, snapshot := collectSnapshot(t, db, nil)
109+
deployment, snapshot := collectSnapshot(t, db, nil)
110+
require.False(t, deployment.IDPOrgSync)
111+
110112
require.Len(t, snapshot.ProvisionerJobs, 1)
111113
require.Len(t, snapshot.Licenses, 1)
112114
require.Len(t, snapshot.Templates, 1)
@@ -153,6 +155,15 @@ func TestTelemetry(t *testing.T) {
153155
for _, entity := range snapshot.Templates {
154156
require.Equal(t, entity.OrganizationID, org.ID)
155157
}
158+
159+
deployment2, _ := collectSnapshot(t, db, func(opts telemetry.Options) telemetry.Options {
160+
opts.OrganizationSyncEnabled = new(func() bool)
161+
*opts.OrganizationSyncEnabled = func() bool {
162+
return true
163+
}
164+
return opts
165+
})
166+
require.True(t, deployment2.IDPOrgSync)
156167
})
157168
t.Run("HashedEmail", func(t *testing.T) {
158169
t.Parallel()

0 commit comments

Comments
 (0)