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

Function TestGetOrganizationSyncSettings

enterprise/coderd/idpsync_test.go:544–576  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

542}
543
544func TestGetOrganizationSyncSettings(t *testing.T) {
545 t.Parallel()
546
547 t.Run("OK", func(t *testing.T) {
548 t.Parallel()
549
550 owner, _, _, user := coderdenttest.NewWithAPI(t, &coderdenttest.Options{
551 LicenseOptions: &coderdenttest.LicenseOptions{
552 Features: license.Features{
553 codersdk.FeatureCustomRoles: 1,
554 codersdk.FeatureMultipleOrganizations: 1,
555 },
556 },
557 })
558
559 expected := map[string][]uuid.UUID{"foo": {user.OrganizationID}}
560
561 ctx := testutil.Context(t, testutil.WaitShort)
562 settings, err := owner.PatchOrganizationIDPSyncSettings(ctx, codersdk.OrganizationSyncSettings{
563 Field: "august",
564 Mapping: expected,
565 })
566
567 require.NoError(t, err)
568 require.Equal(t, "august", settings.Field)
569 require.Equal(t, expected, settings.Mapping)
570
571 settings, err = owner.OrganizationIDPSyncSettings(ctx)
572 require.NoError(t, err)
573 require.Equal(t, "august", settings.Field)
574 require.Equal(t, expected, settings.Mapping)
575 })
576}
577
578func TestPatchOrganizationSyncSettings(t *testing.T) {
579 t.Parallel()

Callers

nothing calls this directly

Calls 6

NewWithAPIFunction · 0.92
ContextFunction · 0.92
RunMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected