File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -97,8 +97,9 @@ describe('AllowedGroups', () => {
9797 await flushPromises ( )
9898
9999 expect ( saveSystemPolicyMock ) . toHaveBeenCalled ( )
100- expect ( saveSystemPolicyMock . mock . calls . at ( - 1 ) ?. [ 0 ] ) . toBe ( 'groups_request_sign' )
101- expect ( saveSystemPolicyMock . mock . calls . at ( - 1 ) ?. [ 1 ] ) . toBe ( '["admin","testGroup"]' )
100+ const firstPersistCall = saveSystemPolicyMock . mock . calls . at ( - 1 ) as [ string , string , boolean ] | undefined
101+ expect ( firstPersistCall ?. [ 0 ] ) . toBe ( 'groups_request_sign' )
102+ expect ( firstPersistCall ?. [ 1 ] ) . toBe ( '["admin","testGroup"]' )
102103
103104 select = wrapper . findComponent ( { name : 'NcSelect' } )
104105
@@ -107,8 +108,9 @@ describe('AllowedGroups', () => {
107108 ] )
108109 await flushPromises ( )
109110
110- expect ( saveSystemPolicyMock . mock . calls . at ( - 1 ) ?. [ 0 ] ) . toBe ( 'groups_request_sign' )
111- expect ( saveSystemPolicyMock . mock . calls . at ( - 1 ) ?. [ 1 ] ) . toBe ( '["admin"]' )
111+ const secondPersistCall = saveSystemPolicyMock . mock . calls . at ( - 1 ) as [ string , string , boolean ] | undefined
112+ expect ( secondPersistCall ?. [ 0 ] ) . toBe ( 'groups_request_sign' )
113+ expect ( secondPersistCall ?. [ 1 ] ) . toBe ( '["admin"]' )
112114 expect ( confirmPasswordMock ) . toHaveBeenCalledTimes ( 2 )
113115 } )
114116} )
You can’t perform that action at this time.
0 commit comments