Add tests for completed view

Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
This commit is contained in:
Raimund Schlüßler 2019-11-03 20:28:20 +01:00
parent e75d7fd0ad
commit b33a08f6d3
No known key found for this signature in database
GPG key ID: 036FA7EB1A599178
2 changed files with 27 additions and 4 deletions

View file

@ -27,7 +27,7 @@ describe('General.vue', () => {
router.push({ name: 'collections', 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="pwen4kz18g.ics"]').exists()).toBe(true)
expect(wrapper.find('li[task-id="pwen4kz19g.ics"]').exists()).toBe(false) expect(wrapper.find('li[task-id="pwen4kz40g.ics"]').exists()).toBe(false)
}) })
/* /*
@ -114,4 +114,13 @@ describe('General.vue', () => {
} }
expect(wrapper.vm.filteredCalendars.length).toBe(1) expect(wrapper.vm.filteredCalendars.length).toBe(1)
}) })
it('Checks that only completed tasks show in the completed view', () => {
const wrapper = mount(General, { localVue, store, router })
if (wrapper.vm.$route.params.collectionId !== 'completed') {
router.push({ name: 'collections', params: { collectionId: 'completed' } })
}
expect(wrapper.find('li[task-id="pwen4kz19g.ics"]').exists()).toBe(false) // Not completed --> hidden
expect(wrapper.find('li[task-id="pwen4kz40g.ics"]').exists()).toBe(true) // Completed --> shown
})
}) })

View file

@ -54,9 +54,6 @@ LAST-MODIFIED:20190918T095816\n
UID:pwen4kz19g\n UID:pwen4kz19g\n
SUMMARY:Calendar 1 - Task 2\n SUMMARY:Calendar 1 - Task 2\n
PRIORITY:9\n PRIORITY:9\n
PERCENT-COMPLETE:100\n
STATUS:COMPLETED\n
COMPLETED:20190918T095816\n
DTSTART:20190918T095816\n DTSTART:20190918T095816\n
END:VTODO\n END:VTODO\n
END:VCALENDAR`, END:VCALENDAR`,
@ -143,6 +140,23 @@ PERCENT-COMPLETE:100\n
STATUS:COMPLETED\n STATUS:COMPLETED\n
COMPLETED:20190918T095816\n COMPLETED:20190918T095816\n
END:VTODO\n END:VTODO\n
END:VCALENDAR`,
`
BEGIN:VCALENDAR\n
VERSION:2.0\n
PRODID:-//Nextcloud Tasks 0.11.3\n
BEGIN:VTODO\n
CREATED:20181119T183919\n
DTSTAMP:20190918T095816\n
LAST-MODIFIED:20190918T095816\n
UID:pwen4kz40g\n
SUMMARY:Calendar 1 - Task 2\n
PRIORITY:9\n
PERCENT-COMPLETE:100\n
STATUS:COMPLETED\n
COMPLETED:20190918T095816\n
DTSTART:20190918T095816\n
END:VTODO\n
END:VCALENDAR` END:VCALENDAR`
], ],
}, },