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-09 23:47:34 +0300
committerRaimund Schlüßler <raimund.schluessler@mailbox.org>2019-11-09 23:47:34 +0300
commit7d2bcbb3d8b6267e34a007c97fd2dac565d4df85 (patch)
tree65a94fb7a81bd05deb291f5813bf0c2a527de3f6 /tests
parent10e773a7a216f64149dd5e035aefb2b564c6b064 (diff)
Add stricter tests for week collection
Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/javascript/unit/components/TheCollections/General.spec.js2
-rw-r--r--tests/javascript/unit/components/TheCollections/Week.spec.js5
-rw-r--r--tests/javascript/unit/setupStore.js54
3 files changed, 60 insertions, 1 deletions
diff --git a/tests/javascript/unit/components/TheCollections/General.spec.js b/tests/javascript/unit/components/TheCollections/General.spec.js
index d0e7aa7e..c3f0a2c9 100644
--- a/tests/javascript/unit/components/TheCollections/General.spec.js
+++ b/tests/javascript/unit/components/TheCollections/General.spec.js
@@ -88,7 +88,7 @@ describe('General.vue', () => {
if (wrapper.vm.$route.params.collectionId !== 'today') {
router.push({ name: 'collections', params: { collectionId: 'today' } })
}
- expect(wrapper.vm.filteredCalendars.length).toBe(1)
+ expect(wrapper.vm.filteredCalendars.length).toBe(2)
})
it('Checks that only today tasks show in the today view', () => {
diff --git a/tests/javascript/unit/components/TheCollections/Week.spec.js b/tests/javascript/unit/components/TheCollections/Week.spec.js
index 53110773..7e8f585a 100644
--- a/tests/javascript/unit/components/TheCollections/Week.spec.js
+++ b/tests/javascript/unit/components/TheCollections/Week.spec.js
@@ -16,6 +16,8 @@ describe('Week.vue', () => {
expect(wrapper.find('div[day="0"] li[task-id="pwen4kz20g.ics"]').exists()).toBe(true) // Has a due subtask --> shown
expect(wrapper.find('div[day="0"] li[task-id="pwen4kz23g.ics"]').exists()).toBe(true) // Due subtask --> shown
expect(wrapper.find('div[day="0"] li[task-id="pwen4kz25g.ics"]').exists()).toBe(false) // Start date in future --> hidden
+ expect(wrapper.find('div[day="0"] li[task-id="pwen8kz22g.ics"]').exists()).toBe(true) // Was due today --> shown
+ expect(wrapper.find('div[day="0"] li[task-id="pwen7kz22g.ics"]').exists()).toBe(false) // Subtask due in 2 days--> hidden
})
it('Checks that the correct tasks are shown for day 1 (tomorrow)', () => {
@@ -26,6 +28,9 @@ describe('Week.vue', () => {
it('Checks that the correct tasks are shown for day 2 (day after tomorrow)', () => {
const wrapper = mount(Week, { localVue, store, router })
expect(wrapper.find('div[day="2"] li[task-id="pwen4kz21g.ics"]').exists()).toBe(true) // Start the day after tomorrow --> shown
+ expect(wrapper.find('div[day="2"] li[task-id="pwen8kz22g.ics"]').exists()).toBe(true) // Was due today, but has subtask due in 2 days --> shown
+ expect(wrapper.find('div[day="2"] li[task-id="pwen7kz22g.ics"]').exists()).toBe(true) // Subtask due in 2 days--> shown
+ expect(wrapper.find('div[day="2"] li[task-id="pwen2kz37g.ics"]').exists()).toBe(false) // Subtask due in a month --> hidden
})
it('Checks that the correct tasks are shown for day 6', () => {
diff --git a/tests/javascript/unit/setupStore.js b/tests/javascript/unit/setupStore.js
index fa6d71dd..955c2290 100644
--- a/tests/javascript/unit/setupStore.js
+++ b/tests/javascript/unit/setupStore.js
@@ -206,6 +206,60 @@ UID:pwen4kz22g\n
SUMMARY:Calendar 2 - Task 2\n
DUE:20190107T120000\n
END:VTODO\n
+END:VCALENDAR`,
+`
+BEGIN:VCALENDAR\n
+VERSION:2.0\n
+PRODID:-//Nextcloud Tasks 0.11.3\n
+BEGIN:VTODO\n
+CREATED:20171119T183919\n
+DTSTAMP:20180918T095816\n
+LAST-MODIFIED:20190918T095816\n
+UID:pwen9kz22g\n
+SUMMARY:Calendar 2 - Task 3\n
+DUE:20180107T120000\n
+END:VTODO\n
+END:VCALENDAR`,
+`
+BEGIN:VCALENDAR\n
+VERSION:2.0\n
+PRODID:-//Nextcloud Tasks 0.11.3\n
+BEGIN:VTODO\n
+CREATED:20171119T183919\n
+DTSTAMP:20180918T095816\n
+LAST-MODIFIED:20190918T095816\n
+UID:pwen8kz22g\n
+SUMMARY:Calendar 2 - Task 3\n
+DUE:20190101T120000\n
+END:VTODO\n
+END:VCALENDAR`,
+`
+BEGIN:VCALENDAR\n
+VERSION:2.0\n
+PRODID:-//Nextcloud Tasks 0.11.3\n
+BEGIN:VTODO\n
+CREATED:20171119T183919\n
+DTSTAMP:20180918T095816\n
+LAST-MODIFIED:20190918T095816\n
+RELATED-TO:pwen8kz22g\n
+UID:pwen7kz22g\n
+SUMMARY:Calendar 2 - Task 3\n
+DUE:20190103T120000\n
+END:VTODO\n
+END:VCALENDAR`,
+`
+BEGIN:VCALENDAR\n
+VERSION:2.0\n
+PRODID:-//Nextcloud Tasks 0.11.3\n
+BEGIN:VTODO\n
+CREATED:20171119T183919\n
+DTSTAMP:20180918T095816\n
+LAST-MODIFIED:20190918T095816\n
+RELATED-TO:pwen8kz22g\n
+UID:pwen2kz37g\n
+SUMMARY:Calendar 2 - Task 3\n
+DUE:20190203T120000\n
+END:VTODO\n
END:VCALENDAR`
],
},