From a9ff17bf2167122f7655cebb4d9587ab41527230 Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Mon, 22 Nov 2021 11:17:12 -0300 Subject: [PATCH] 18128: Fixes unit test due to behavior change. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- .../multi-panel-view/multi-panel-view.test.tsx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/components/multi-panel-view/multi-panel-view.test.tsx b/src/components/multi-panel-view/multi-panel-view.test.tsx index 53a3bb60..6cf13d78 100644 --- a/src/components/multi-panel-view/multi-panel-view.test.tsx +++ b/src/components/multi-panel-view/multi-panel-view.test.tsx @@ -22,7 +22,7 @@ describe('', () => { }; }); - it('should show default toggle buttons for every child', () => { + it('should show default panel buttons for every child', () => { const childs = [ This is one panel, This is another panel, @@ -34,25 +34,27 @@ describe('', () => { expect(wrapper.html()).toContain('This is another panel'); }); - it('should toggle panel when clicking on its button', () => { + it('should show panel when clicking on its button', () => { const childs = [ This is one panel, ]; - const wrapper = mount({[...childs]}); + props.panelStates = [ + {name: 'Initially invisible Panel', visible: false}, + ] - // Initial state: panel visible - expect(wrapper.html()).toContain('This is one panel'); + const wrapper = mount({[...childs]}); - // Panel toggling - wrapper.find(Button).simulate('click'); + // Initial state: panel not visible expect(wrapper.html()).not.toContain('This is one panel'); expect(wrapper.html()).toContain('All panels are hidden'); + + // Panel visible when clicking on its button wrapper.find(Button).simulate('click'); expect(wrapper.html()).toContain('This is one panel'); expect(wrapper.html()).not.toContain('All panels are hidden'); }); - it('should show custom toggle buttons when config provided', () => { + it('should show custom panel buttons when config provided', () => { const childs = [ This is one panel, This is another panel, -- 2.30.2