Check that only clicked tasks are active

Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
This commit is contained in:
Raimund Schlüßler 2019-11-12 12:16:53 +01:00
parent 21c7d8f075
commit 212982404d
No known key found for this signature in database
GPG key ID: 036FA7EB1A599178

View file

@ -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
})
})