Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite75e179

Browse files
committed
feat: add stories for IdpOrgSyncPageview
1 parentfe17b1c commite75e179

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
importtype{Meta,StoryObj}from"@storybook/react";
2+
import{expect,userEvent,within}from"@storybook/test";
3+
import{
4+
MockOrganization,
5+
MockOrganization2,
6+
MockOrganizationSyncSettings,
7+
MockOrganizationSyncSettings2,
8+
}from"testHelpers/entities";
9+
import{IdpOrgSyncPageView}from"./IdpOrgSyncPageView";
10+
11+
constmeta:Meta<typeofIdpOrgSyncPageView>={
12+
title:"pages/IdpOrgSyncPageView",
13+
component:IdpOrgSyncPageView,
14+
};
15+
16+
exportdefaultmeta;
17+
typeStory=StoryObj<typeofIdpOrgSyncPageView>;
18+
19+
exportconstEmpty:Story={
20+
args:{
21+
organizationSyncSettings:{
22+
field:"",
23+
mapping:{},
24+
organization_assign_default:true,
25+
},
26+
organizations:[MockOrganization,MockOrganization2],
27+
error:undefined,
28+
},
29+
};
30+
31+
exportconstDefault:Story={
32+
args:{
33+
organizationSyncSettings:MockOrganizationSyncSettings2,
34+
organizations:[MockOrganization,MockOrganization2],
35+
error:undefined,
36+
},
37+
};
38+
39+
exportconstHasError:Story={
40+
args:{
41+
...Default.args,
42+
error:"This is a test error",
43+
},
44+
};
45+
46+
exportconstMissingGroups:Story={
47+
args:{
48+
...Default.args,
49+
organizationSyncSettings:MockOrganizationSyncSettings,
50+
},
51+
};
52+
53+
// export const RolesTab: Story = {
54+
// args: {
55+
// ...Default.args,
56+
// },
57+
// play: async ({ canvasElement }) => {
58+
// const user = userEvent.setup();
59+
// const canvas = within(canvasElement);
60+
// const rolesTab = await canvas.findByText("Role Sync Settings");
61+
// await user.click(rolesTab);
62+
// await expect(canvas.findByText("IdP Role")).resolves.toBeVisible();
63+
// },
64+
// };

‎site/src/testHelpers/entities.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2686,6 +2686,16 @@ export const MockOrganizationSyncSettings: TypesGen.OrganizationSyncSettings = {
26862686
organization_assign_default:true,
26872687
};
26882688

2689+
exportconstMockOrganizationSyncSettings2:TypesGen.OrganizationSyncSettings=
2690+
{
2691+
field:"organization-test",
2692+
mapping:{
2693+
"idp-org-1":["my-organization-id","my-organization-2-id"],
2694+
"idp-org-2":["my-organization-id"],
2695+
},
2696+
organization_assign_default:true,
2697+
};
2698+
26892699
exportconstMockGroup:TypesGen.Group={
26902700
id:"fbd2116a-8961-4954-87ae-e4575bd29ce0",
26912701
name:"Front-End",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp