Add test to loading more reports on scroll

This commit is contained in:
Angelina Filippova 2019-04-03 22:26:39 +03:00
parent 0e22183c73
commit 7d778db81d

View file

@ -71,4 +71,15 @@ describe('Reports', () => {
wrapper.find('.new-note .el-icon-close').trigger('click')
expect(noteTextArea.isVisible()).toBe(false)
})
it('loads more reports on scroll', () => {
const wrapper = mount(Reports, {
store,
localVue
})
expect(store.state.reports.fetchedReports.length).toEqual(3)
window.dispatchEvent(new CustomEvent('scroll', { detail: 2000 }))
expect(store.state.reports.fetchedReports.length).toEqual(6)
})
})