From: Lucas Di Pentima Date: Mon, 22 Nov 2021 14:17:12 +0000 (-0300) Subject: 18128: Fixes unit test due to behavior change. X-Git-Tag: 2.4.0~25^2~1 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/a9ff17bf2167122f7655cebb4d9587ab41527230?ds=sidebyside 18128: Fixes unit test due to behavior change. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- 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,