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

Commitd7afcfc

Browse files
committed
Add more stories for deployment dropdown
1 parent185f2c0 commitd7afcfc

File tree

1 file changed

+41
-3
lines changed

1 file changed

+41
-3
lines changed

‎site/src/modules/dashboard/Navbar/NavbarView.stories.tsx

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
importtype{Meta,StoryObj}from"@storybook/react";
2+
import{within,userEvent}from"@storybook/test";
23
import{chromaticWithTablet}from"testHelpers/chromatic";
34
import{MockUser,MockUser2}from"testHelpers/entities";
45
import{withDashboardProvider}from"testHelpers/storybook";
@@ -10,26 +11,63 @@ const meta: Meta<typeof NavbarView> = {
1011
component:NavbarView,
1112
args:{
1213
user:MockUser,
14+
canViewAllUsers:true,
1315
canViewAuditLog:true,
1416
canViewDeployment:true,
15-
canViewAllUsers:true,
1617
canViewHealth:true,
18+
canViewOrganizations:true,
1719
},
1820
decorators:[withDashboardProvider],
1921
};
2022

2123
exportdefaultmeta;
2224
typeStory=StoryObj<typeofNavbarView>;
2325

24-
exportconstForAdmin:Story={};
26+
exportconstForAdmin:Story={
27+
play:async({ canvasElement})=>{
28+
constcanvas=within(canvasElement);
29+
awaituserEvent.click(canvas.getByRole("button",{name:"Deployment"}));
30+
},
31+
};
32+
33+
exportconstForAuditor:Story={
34+
args:{
35+
user:MockUser2,
36+
canViewAllUsers:false,
37+
canViewAuditLog:true,
38+
canViewDeployment:false,
39+
canViewHealth:false,
40+
canViewOrganizations:false,
41+
},
42+
play:async({ canvasElement})=>{
43+
constcanvas=within(canvasElement);
44+
awaituserEvent.click(canvas.getByRole("button",{name:"Deployment"}));
45+
},
46+
};
47+
48+
exportconstForOrgAdmin:Story={
49+
args:{
50+
user:MockUser2,
51+
canViewAllUsers:false,
52+
canViewAuditLog:true,
53+
canViewDeployment:false,
54+
canViewHealth:false,
55+
canViewOrganizations:true,
56+
},
57+
play:async({ canvasElement})=>{
58+
constcanvas=within(canvasElement);
59+
awaituserEvent.click(canvas.getByRole("button",{name:"Deployment"}));
60+
},
61+
};
2562

2663
exportconstForMember:Story={
2764
args:{
2865
user:MockUser2,
66+
canViewAllUsers:false,
2967
canViewAuditLog:false,
3068
canViewDeployment:false,
31-
canViewAllUsers:false,
3269
canViewHealth:false,
70+
canViewOrganizations:false,
3371
},
3472
};
3573

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp