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-11-03 22:28:20 +0300
committerRaimund Schlüßler <raimund.schluessler@mailbox.org>2019-11-03 22:28:20 +0300
commitb33a08f6d34f7973f44f379608908b19369864d7 (patch)
tree8c948c20a86d892f5824c7e1206ca216d48300fe /tests
parente75d7fd0ade43011888d4fe83a289dd9ef6cf961 (diff)
Add tests for completed 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.js20
2 files changed, 27 insertions, 4 deletions
diff --git a/tests/javascript/unit/components/TheCollections/General.spec.js b/tests/javascript/unit/components/TheCollections/General.spec.js
index fad76e72..d0e7aa7e 100644
--- a/tests/javascript/unit/components/TheCollections/General.spec.js
+++ b/tests/javascript/unit/components/TheCollections/General.spec.js
@@ -27,7 +27,7 @@ describe('General.vue', () => {
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)
+ 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)
})
+
+ 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
+ })
})
diff --git a/tests/javascript/unit/setupStore.js b/tests/javascript/unit/setupStore.js
index 232d1a22..9d398285 100644
--- a/tests/javascript/unit/setupStore.js
+++ b/tests/javascript/unit/setupStore.js
@@ -54,9 +54,6 @@ 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
DTSTART:20190918T095816\n
END:VTODO\n
END:VCALENDAR`,
@@ -143,6 +140,23 @@ PERCENT-COMPLETE:100\n
STATUS:COMPLETED\n
COMPLETED:20190918T095816\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`
],
},