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-12 15:27:36 +0300
committerRaimund Schlüßler <raimund.schluessler@mailbox.org>2019-11-12 15:27:36 +0300
commit12cd165975d95871e06cc59b4d9acd25abe0335f (patch)
tree4f04a76bef7afabb4395ce050cb4c85ec832c1ac /tests
parent94f6d996b4d1d8f69b45fdada1d7912f27b0b3ee (diff)
Add a week view test
Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/javascript/unit/components/TheCollections/Week.spec.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/javascript/unit/components/TheCollections/Week.spec.js b/tests/javascript/unit/components/TheCollections/Week.spec.js
index 4778dcd3..204bb069 100644
--- a/tests/javascript/unit/components/TheCollections/Week.spec.js
+++ b/tests/javascript/unit/components/TheCollections/Week.spec.js
@@ -49,4 +49,26 @@ describe('Week.vue', () => {
expect(taskAtDay0.classes('active')).toBe(true) // Should be shown active, since it was clicked
expect(taskAtDay2.classes('active')).toBe(false) // Shouldn't be shown active, since it was not clicked
})
+
+ it('Checks that not matching subtasks are only shown for active tasks', () => {
+ const wrapper = mount(Week, { localVue, store, router })
+ let taskAtDay0 = wrapper.find('div[day="0"] li[task-id="pwen8kz22g.ics"] > div')
+
+ if (wrapper.vm.$route.params.taskId !== null) {
+ router.push({ name: 'collections', params: { collectionId: 'week' } })
+ }
+ expect(taskAtDay0.classes('active')).toBe(false)
+
+ expect(wrapper.find('div[day="0"] li[task-id="pwen7kz22g.ics"]').exists()).toBe(false) // Not shown, since it doesn't match collection
+ expect(wrapper.find('div[day="0"] li[task-id="pwen2kz37g.ics"]').exists()).toBe(false) // Not shown, since it doesn't match collection
+ expect(wrapper.find('div[day="2"] li[task-id="pwen7kz22g.ics"]').exists()).toBe(true) // Shown, since it is due in 2 days
+
+ // Click on first task to open it
+ taskAtDay0.trigger('click')
+ expect(taskAtDay0.classes('active')).toBe(true)
+
+ expect(wrapper.find('div[day="0"] li[task-id="pwen7kz22g.ics"]').exists()).toBe(true) // Shown now, because parent is active
+ expect(wrapper.find('div[day="0"] li[task-id="pwen2kz37g.ics"]').exists()).toBe(true) // Shown now, because parent is active
+ expect(wrapper.find('div[day="2"] li[task-id="pwen2kz37g.ics"]').exists()).toBe(false) // Not shown, since parent is not active
+ })
})