Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/tasks.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRaimund Schlüßler <raimund.schluessler@mailbox.org>2019-10-30 23:02:23 +0300
committerRaimund Schlüßler <raimund.schluessler@mailbox.org>2019-10-30 23:02:23 +0300
commit54ceae13f526e3364a8e30cb02bf2a828fef4927 (patch)
tree0e797d577fc0a10bc6967babc83b94dc5d538edc /tests
parent5cd822fde4aec09a1888ee9af5131e4256a923ee (diff)
Add test for all view
Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/javascript/unit/components/TheCollections/General.spec.js11
-rw-r--r--tests/javascript/unit/setupStore.js3
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`,
`