mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
Fix: Vue's nextTick doesn't wait for jest mocks to resolve
This commit is contained in:
parent
801eb1e515
commit
0b916012e8
@ -59,9 +59,14 @@ describe('FollowList.vue', () => {
|
||||
expect(wrapper.findAll('.user-teaser').length).toEqual(user[type].length)
|
||||
})
|
||||
it(`has a button to load all remaining users ${type}`, async () => {
|
||||
jest.useFakeTimers()
|
||||
|
||||
wrapper.find('button').trigger('click')
|
||||
//await wrapper.vm.$nextTick()
|
||||
//expect(wrapper.vm.connections.length).toBe(user[`${type}Count`])
|
||||
|
||||
await jest.runAllTicks()
|
||||
await wrapper.vm.$nextTick()
|
||||
|
||||
expect(wrapper.vm.connections.length).toBe(user[`${type}Count`])
|
||||
expect(queryMock).toHaveBeenCalledWith({
|
||||
query: wrapper.vm.queries[type],
|
||||
variables: { id: user.id },
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user