Fix tests

This commit is contained in:
Angelina Filippova 2020-07-18 00:13:06 +03:00
parent d211d4f934
commit a70a5bb15c
2 changed files with 6 additions and 4 deletions

View file

@ -156,11 +156,13 @@ describe('Users actions', () => {
stubs: ['router-link']
})
await flushPromises()
expect(store.state.users.fetchedUsers.length).toEqual(3)
expect(store.state.users.fetchedUsers[1].deactivated).toBe(false)
wrapper.find(htmlElement(2, 2)).trigger('click')
store.dispatch('DeleteUsers', { users: [{ active: true, deactivated: false, id: '10', nickname: 'bob', local: false, external: true, roles: { admin: false, moderator: false }, tags: ['sandbox'] }] })
await flushPromises()
expect(store.state.users.fetchedUsers.length).toEqual(2)
expect(store.state.users.fetchedUsers[1].deactivated).toBe(true)
done()
})

View file

@ -225,11 +225,11 @@ describe('Apply users actions to multiple users', () => {
expect(wrapper.vm.deleteMultipleUsers).toHaveBeenCalled()
const remove = wrapper.vm.mappers().remove
expect(store.state.users.fetchedUsers.length).toEqual(3)
expect(store.state.users.fetchedUsers.filter(user => user.deactivated).length).toEqual(1)
remove()
await flushPromises()
expect(store.state.users.fetchedUsers.length).toEqual(0)
expect(store.state.users.fetchedUsers.length).toEqual(3)
done()
})