Add test to loading more reports on scroll
This commit is contained in:
parent
0e22183c73
commit
7d778db81d
1 changed files with 11 additions and 0 deletions
|
@ -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)
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue