Skip to content

Commit 49bd792

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

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,10 @@ describe('Settings/Validation.vue', () => {
145145
await input.trigger('input')
146146

147147
expect(saveSystemPolicyMock).toHaveBeenCalled()
148-
expect(saveSystemPolicyMock.mock.calls.at(-1)?.[0]).toBe('add_footer')
149-
expect(saveSystemPolicyMock.mock.calls.at(-1)?.[2]).toBe(false)
150-
const savedPayload = String(saveSystemPolicyMock.mock.calls.at(-1)?.[1] ?? '')
148+
const saveCall = saveSystemPolicyMock.mock.calls.at(-1) as [string, unknown, boolean] | undefined
149+
expect(saveCall?.[0]).toBe('add_footer')
150+
expect(saveCall?.[2]).toBe(false)
151+
const savedPayload = String(saveCall?.[1] ?? '')
151152
expect(savedPayload).toContain('https://custom.test/validation')
152153
})
153154

@@ -164,7 +165,8 @@ describe('Settings/Validation.vue', () => {
164165
await wrapper.vm.onCustomizeFooterChange(false)
165166

166167
expect(saveSystemPolicyMock).toHaveBeenCalled()
167-
expect(saveSystemPolicyMock.mock.calls.at(-1)?.[0]).toBe('add_footer')
168+
const customizeCall = saveSystemPolicyMock.mock.calls.at(-1) as [string, unknown, boolean] | undefined
169+
expect(customizeCall?.[0]).toBe('add_footer')
168170
expect(wrapper.vm.isDefaultFooterTemplate).toBe(true)
169171
})
170172

0 commit comments

Comments
 (0)