diff options
author | Raimund Schlüßler <raimund.schluessler@mailbox.org> | 2019-11-03 00:21:34 +0300 |
---|---|---|
committer | Raimund Schlüßler <raimund.schluessler@mailbox.org> | 2019-11-03 09:46:52 +0300 |
commit | a80b78d9465b367d40ae1e39e02e36b367462123 (patch) | |
tree | 616f574c02968cc8f3e9468fd79de86cd91ae680 /tests | |
parent | 229747ef26f88c466b84db027e31e495fb75ae83 (diff) |
Add simple test for today 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.js | 10 | ||||
-rw-r--r-- | tests/javascript/unit/setup.js | 5 | ||||
-rw-r--r-- | tests/javascript/unit/setupStore.js | 1 |
3 files changed, 15 insertions, 1 deletions
diff --git a/tests/javascript/unit/components/TheCollections/General.spec.js b/tests/javascript/unit/components/TheCollections/General.spec.js index 213eb5d3..1c9e54cf 100644 --- a/tests/javascript/unit/components/TheCollections/General.spec.js +++ b/tests/javascript/unit/components/TheCollections/General.spec.js @@ -88,7 +88,15 @@ describe('General.vue', () => { if (wrapper.vm.$route.params.collectionId !== 'today') { router.push({ name: 'collections', params: { collectionId: 'today' } }) } - expect(wrapper.vm.filteredCalendars.length).toBe(0) + expect(wrapper.vm.filteredCalendars.length).toBe(1) + }) + + it('Checks that only today tasks show in the today view', () => { + const wrapper = mount(General, { localVue, store, router }) + if (wrapper.vm.$route.params.collectionId !== 'today') { + router.push({ name: 'collections', params: { collectionId: 'today' } }) + } + expect(wrapper.find('li[task-id="pwen4kz18g.ics"]').exists()).toBe(true) // Already due --> shown }) /* diff --git a/tests/javascript/unit/setup.js b/tests/javascript/unit/setup.js index 6f72d3d1..47121071 100644 --- a/tests/javascript/unit/setup.js +++ b/tests/javascript/unit/setup.js @@ -22,6 +22,11 @@ VueTestUtils.config.mocks.$n = function(app, singular, plural, count) { VueTestUtils.config.mocks.n = VueTestUtils.config.mocks.$n global.n = VueTestUtils.config.mocks.$n +global.OCA = {} +global.OCA.Tasks = {} +global.OCA.Tasks.$t = VueTestUtils.config.mocks.$t +global.OCA.Tasks.$n = VueTestUtils.config.mocks.$n + afterAll(() => { MockDate.reset() }); diff --git a/tests/javascript/unit/setupStore.js b/tests/javascript/unit/setupStore.js index 9f8a3c2e..4c76c2fc 100644 --- a/tests/javascript/unit/setupStore.js +++ b/tests/javascript/unit/setupStore.js @@ -40,6 +40,7 @@ LAST-MODIFIED:20190918T095816\n UID:pwen4kz18g\n SUMMARY:Calendar 1 - Task 1\n PRIORITY:1\n +DUE:20190101T123400\n END:VTODO\n END:VCALENDAR`, ` |