diff options
author | Raimund Schlüßler <raimund.schluessler@mailbox.org> | 2019-11-12 14:16:53 +0300 |
---|---|---|
committer | Raimund Schlüßler <raimund.schluessler@mailbox.org> | 2019-11-12 14:16:53 +0300 |
commit | 212982404ded5b99ac17d20f46aa1afd25ae1f93 (patch) | |
tree | 287b4923e36753eb404539eeae165c043b3ecd47 /tests | |
parent | 21c7d8f075c5d86d7e608978a674023ef88bc10b (diff) |
Check that only clicked tasks are active
Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/javascript/unit/components/TheCollections/Week.spec.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/javascript/unit/components/TheCollections/Week.spec.js b/tests/javascript/unit/components/TheCollections/Week.spec.js index 7e8f585a..4778dcd3 100644 --- a/tests/javascript/unit/components/TheCollections/Week.spec.js +++ b/tests/javascript/unit/components/TheCollections/Week.spec.js @@ -37,4 +37,16 @@ describe('Week.vue', () => { const wrapper = mount(Week, { localVue, store, router }) expect(wrapper.find('div[day="6"] li[task-id="pwen4kz22g.ics"]').exists()).toBe(true) // Starts in 7 days --> shown }) + + it('Checks that only the clicked task is marked active', () => { + const wrapper = mount(Week, { localVue, store, router }) + let taskAtDay0 = wrapper.find('div[day="0"] li[task-id="pwen8kz22g.ics"] > div') + let taskAtDay2 = wrapper.find('div[day="2"] li[task-id="pwen8kz22g.ics"] > div') + + // Click on first task to open it + taskAtDay0.trigger('click') + + 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 + }) }) |