From 894ea3064d3d6b7e70a7beb11da9c170488c25f2 Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Wed, 3 Apr 2019 18:42:44 +0300 Subject: [PATCH] Add test to showing notes on click --- test/views/reports/index.test.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/views/reports/index.test.js b/test/views/reports/index.test.js index 0ad08258..24ec23d8 100644 --- a/test/views/reports/index.test.js +++ b/test/views/reports/index.test.js @@ -31,4 +31,21 @@ describe('Reports', () => { expect(initialReports).toEqual(3) done() }) + + it('shows notes', () => { + const wrapper = mount(Reports, { + store, + localVue + }) + + const note = wrapper.find('.el-collapse-item__content') + expect(note.isVisible()).toBe(false) + + const button = wrapper.find('.el-collapse-item__header') + button.trigger('click') + expect(note.isVisible()).toBe(true) + + button.trigger('click') + expect(note.isVisible()).toBe(false) + }) })