mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
test watchers
This commit is contained in:
parent
d88c16a66c
commit
0c6d63331f
@ -230,6 +230,22 @@ describe('Creation', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('watchers', () => {
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks()
|
||||
})
|
||||
|
||||
it('calls API when criteria changes', async () => {
|
||||
await wrapper.setData({ criteria: 'XX' })
|
||||
expect(apolloQueryMock).toBeCalled()
|
||||
})
|
||||
|
||||
it('calls API when currentPage changes', async () => {
|
||||
await wrapper.setData({ currentPage: 2 })
|
||||
expect(apolloQueryMock).toBeCalled()
|
||||
})
|
||||
})
|
||||
|
||||
describe('apollo returns error', () => {
|
||||
beforeEach(() => {
|
||||
apolloQueryMock.mockRejectedValue({
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user