1
1
import type { Meta , StoryObj } from "@storybook/react" ;
2
- import { expect , userEvent , within } from "@storybook/test" ;
2
+ import { expect , userEvent } from "@storybook/test" ;
3
3
import {
4
4
MockGroup ,
5
5
MockGroup2 ,
@@ -23,7 +23,7 @@ const meta: Meta<typeof IdpSyncPageView> = {
23
23
tab : "groups" ,
24
24
groupSyncSettings : MockGroupSyncSettings ,
25
25
roleSyncSettings : MockRoleSyncSettings ,
26
- fieldValues : [
26
+ claimFieldValues : [
27
27
...Object . keys ( MockGroupSyncSettings . mapping ) ,
28
28
...Object . keys ( MockRoleSyncSettings . mapping ) ,
29
29
] ,
@@ -73,15 +73,21 @@ export const MissingGroups: Story = {
73
73
export const WithLegacyMapping : Story = {
74
74
args : {
75
75
groupSyncSettings : MockLegacyMappingGroupSyncSettings ,
76
- fieldValues : Object . keys (
76
+ claimFieldValues : Object . keys (
77
77
MockLegacyMappingGroupSyncSettings . legacy_group_name_mapping ,
78
78
) ,
79
79
} ,
80
80
} ;
81
81
82
82
export const GroupsTabMissingClaims : Story = {
83
83
args : {
84
- fieldValues : [ ] ,
84
+ claimFieldValues : [ ] ,
85
+ } ,
86
+ play : async ( { canvasElement } ) => {
87
+ const user = userEvent . setup ( ) ;
88
+ const warning = canvasElement . querySelector ( ".lucide-triangle-alert" ) ! ;
89
+ expect ( warning ) . not . toBe ( null ) ;
90
+ await user . hover ( warning ) ;
85
91
} ,
86
92
} ;
87
93
@@ -94,6 +100,12 @@ export const RolesTab: Story = {
94
100
export const RolesTabMissingClaims : Story = {
95
101
args : {
96
102
tab : "roles" ,
97
- fieldValues : [ ] ,
103
+ claimFieldValues : [ ] ,
104
+ } ,
105
+ play : async ( { canvasElement } ) => {
106
+ const user = userEvent . setup ( ) ;
107
+ const warning = canvasElement . querySelector ( ".lucide-triangle-alert" ) ! ;
108
+ expect ( warning ) . not . toBe ( null ) ;
109
+ await user . hover ( warning ) ;
98
110
} ,
99
111
} ;
0 commit comments