Skip to content

Commit 7362f6a

Browse files
committed
test(types): fix allowed groups mock call tuple typing
Signed-off-by: Vitor Mattos <[email protected]>
1 parent 77761cc commit 7362f6a

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/tests/views/Settings/AllowedGroups.spec.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff 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
})

0 commit comments

Comments
 (0)