Skip to content

Commit 5e97617

Browse files
committed
test: add third mock group to IdpSyncPageView stories
1 parent 7b62b8a commit 5e97617

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

site/src/pages/OrganizationSettingsPage/IdpSyncPage/IdpSyncPageView.stories.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,18 @@ import {
33
MockGroup2,
44
MockGroupSyncSettings,
55
MockGroupSyncSettings2,
6+
MockMultipleOverflowGroupSyncSettings,
67
MockLegacyMappingGroupSyncSettings,
78
MockOrganization,
89
MockRoleSyncSettings,
10+
MockGroup3,
911
} from "testHelpers/entities";
1012
import type { Meta, StoryObj } from "@storybook/react-vite";
1113
import { expect, userEvent } from "storybook/test";
1214
import IdpSyncPageView from "./IdpSyncPageView";
1315

1416
const groupsMap = new Map<string, string>();
15-
for (const group of [MockGroup, MockGroup2]) {
17+
for (const group of [MockGroup, MockGroup2, MockGroup3]) {
1618
groupsMap.set(group.id, group.display_name || group.name);
1719
}
1820

@@ -70,6 +72,12 @@ export const MissingGroups: Story = {
7072
},
7173
};
7274

75+
export const MultipleOverflowGroups: Story = {
76+
args: {
77+
groupSyncSettings: MockMultipleOverflowGroupSyncSettings,
78+
},
79+
};
80+
7381
export const WithLegacyMapping: Story = {
7482
args: {
7583
groupSyncSettings: MockLegacyMappingGroupSyncSettings,

site/src/testHelpers/entities.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2914,6 +2914,20 @@ export const MockGroupSyncSettings2: TypesGen.GroupSyncSettings = {
29142914
auto_create_missing_groups: false,
29152915
};
29162916

2917+
export const MockMultipleOverflowGroupSyncSettings: TypesGen.GroupSyncSettings =
2918+
{
2919+
field: "group-multiple-overflow-test",
2920+
mapping: {
2921+
"idp-group-1": [
2922+
"fbd2116a-8961-4954-87ae-e4575bd29ce0",
2923+
"13de3eb4-9b4f-49e7-b0f8-0c3728a0d2e2",
2924+
"d3562dc1-c120-43a9-ba02-88e43bbca192",
2925+
],
2926+
},
2927+
regex_filter: "@[a-zA-Z0-9_]+",
2928+
auto_create_missing_groups: false,
2929+
};
2930+
29172931
export const MockRoleSyncSettings: TypesGen.RoleSyncSettings = {
29182932
field: "role-test",
29192933
mapping: {
@@ -2983,6 +2997,20 @@ export const MockGroup2: TypesGen.Group = {
29832997
total_member_count: 2,
29842998
};
29852999

3000+
export const MockGroup3: TypesGen.Group = {
3001+
id: "d3562dc1-c120-43a9-ba02-88e43bbca192",
3002+
name: "Back-End",
3003+
display_name: "",
3004+
avatar_url: "https://example.com",
3005+
organization_id: MockOrganization.id,
3006+
organization_name: MockOrganization.name,
3007+
organization_display_name: MockOrganization.display_name,
3008+
members: [MockUserOwner, MockUserMember],
3009+
quota_allowance: 5,
3010+
source: "user",
3011+
total_member_count: 2,
3012+
};
3013+
29863014
const MockEveryoneGroup: TypesGen.Group = {
29873015
// The "Everyone" group must have the same ID as a the organization it belongs
29883016
// to.

0 commit comments

Comments
 (0)