projects
/
arvados-workbench2.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
15768: copy button copies string of selected uuids Arvados-DCO-1.1-Signed-off-by...
[arvados-workbench2.git]
/
src
/
components
/
multi-panel-view
/
multi-panel-view.test.tsx
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 53a3bb6089f80324172f4f6d164cdc1833e4dc89..3f4911c2258780963b32dea7c01645078b3e1057 100644
(file)
--- a/
src/components/multi-panel-view/multi-panel-view.test.tsx
+++ b/
src/components/multi-panel-view/multi-panel-view.test.tsx
@@
-10,7
+10,7
@@
import { Button } from "@material-ui/core";
configure({ adapter: new Adapter() });
configure({ adapter: new Adapter() });
-const PanelMock = ({panelName, panelMaximized, doHidePanel, doMaximizePanel, children, ...rest}) =>
+const PanelMock = ({panelName, panelMaximized, doHidePanel, doMaximizePanel,
doUnMaximizePanel, panelIlluminated, panelRef,
children, ...rest}) =>
<div {...rest}>{children}</div>;
describe('<MPVContainer />', () => {
<div {...rest}>{children}</div>;
describe('<MPVContainer />', () => {
@@
-22,7
+22,7
@@
describe('<MPVContainer />', () => {
};
});
};
});
- it('should show default
toggle
buttons for every child', () => {
+ it('should show default
panel
buttons for every child', () => {
const childs = [
<PanelMock key={1}>This is one panel</PanelMock>,
<PanelMock key={2}>This is another panel</PanelMock>,
const childs = [
<PanelMock key={1}>This is one panel</PanelMock>,
<PanelMock key={2}>This is another panel</PanelMock>,
@@
-34,25
+34,27
@@
describe('<MPVContainer />', () => {
expect(wrapper.html()).toContain('This is another panel');
});
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 = [
<PanelMock key={1}>This is one panel</PanelMock>,
];
const childs = [
<PanelMock key={1}>This is one panel</PanelMock>,
];
- const wrapper = mount(<MPVContainer {...props}>{[...childs]}</MPVContainer>);
+ props.panelStates = [
+ {name: 'Initially invisible Panel', visible: false},
+ ]
- // Initial state: panel visible
- expect(wrapper.html()).toContain('This is one panel');
+ const wrapper = mount(<MPVContainer {...props}>{[...childs]}</MPVContainer>);
- // 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');
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');
});
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 = [
<PanelMock key={1}>This is one panel</PanelMock>,
<PanelMock key={2}>This is another panel</PanelMock>,
const childs = [
<PanelMock key={1}>This is one panel</PanelMock>,
<PanelMock key={2}>This is another panel</PanelMock>,