From 212982404ded5b99ac17d20f46aa1afd25ae1f93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raimund=20Schl=C3=BC=C3=9Fler?= Date: Tue, 12 Nov 2019 12:16:53 +0100 Subject: [PATCH] Check that only clicked tasks are active MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Raimund Schlüßler --- .../unit/components/TheCollections/Week.spec.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 + }) })