diff options
-rw-r--r-- | tests/javascript/unit/components/TheCollections/General.spec.js | 11 | ||||
-rw-r--r-- | tests/javascript/unit/setupStore.js | 3 |
2 files changed, 13 insertions, 1 deletions
diff --git a/tests/javascript/unit/components/TheCollections/General.spec.js b/tests/javascript/unit/components/TheCollections/General.spec.js index b892a434..ffc514f2 100644 --- a/tests/javascript/unit/components/TheCollections/General.spec.js +++ b/tests/javascript/unit/components/TheCollections/General.spec.js @@ -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) }) }) diff --git a/tests/javascript/unit/setupStore.js b/tests/javascript/unit/setupStore.js index 249c34d5..214a47f3 100644 --- a/tests/javascript/unit/setupStore.js +++ b/tests/javascript/unit/setupStore.js @@ -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`, ` |