Add test for all view

Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
This commit is contained in:
Raimund Schlüßler 2019-10-30 21:02:23 +01:00
parent 5cd822fde4
commit 54ceae13f5
No known key found for this signature in database
GPG key ID: 036FA7EB1A599178
2 changed files with 13 additions and 1 deletions

View file

@ -18,6 +18,15 @@ describe('General.vue', () => {
expect(wrapper.vm.calendars.length).toBe(2)
})
it('Checks that only uncompleted tasks show in the all view', () => {
const wrapper = mount(General, { localVue, store, router })
if (wrapper.vm.$route.params.collectionId !== 'all') {
router.push({ name: 'collections', params: { collectionId: 'all' } })
}
expect(wrapper.find('li[task-id="pwen4kz18g.ics"]').exists()).toBe(true)
expect(wrapper.find('li[task-id="pwen4kz19g.ics"]').exists()).toBe(false)
})
it('Checks that we get the correct number of calendars for the starred view', () => {
const wrapper = mount(General, { localVue, store, router })
if (wrapper.vm.$route.params.collectionId !== 'starred') {
@ -47,6 +56,6 @@ describe('General.vue', () => {
if (wrapper.vm.$route.params.collectionId !== 'completed') {
router.push({ name: 'collections', params: { collectionId: 'completed' } })
}
expect(wrapper.vm.filteredCalendars.length).toBe(0)
expect(wrapper.vm.filteredCalendars.length).toBe(1)
})
})

View file

@ -53,6 +53,9 @@ LAST-MODIFIED:20190918T095816\n
UID:pwen4kz19g\n
SUMMARY:Calendar 1 - Task 2\n
PRIORITY:9\n
PERCENT-COMPLETE:100\n
STATUS:COMPLETED\n
COMPLETED:20190918T095816\n
END:VTODO\n
END:VCALENDAR`,
`