Skip to content

Commit

Permalink
Adapt SidebarPanel test for the usage of the new Dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
acelaya committed Apr 17, 2023
1 parent 8debe19 commit 52b7e70
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/sidebar/components/test/SidebarPanel-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('SidebarPanel', () => {
fakeScrollIntoView = sinon.stub();

fakeStore = {
isSidebarPanelOpen: sinon.stub().returns(false),
isSidebarPanelOpen: sinon.stub().returns(true),
toggleSidebarPanel: sinon.stub(),
};

Expand All @@ -36,16 +36,16 @@ describe('SidebarPanel', () => {
icon: 'restricted',
});

const panel = wrapper.find('Panel');
const dialog = wrapper.find('Dialog');

assert.equal(panel.props().icon, 'restricted');
assert.equal(panel.props().title, 'My Panel');
assert.equal(dialog.props().icon, 'restricted');
assert.equal(dialog.props().title, 'My Panel');
});

it('provides an `onClose` handler that closes the panel', () => {
const wrapper = createSidebarPanel({ panelName: 'flibberty' });

wrapper.find('Panel').props().onClose();
wrapper.find('Dialog').props().onClose();

assert.calledWith(fakeStore.toggleSidebarPanel, 'flibberty', false);
});
Expand All @@ -59,7 +59,7 @@ describe('SidebarPanel', () => {
it('hides content if not active', () => {
fakeStore.isSidebarPanelOpen.returns(false);
const wrapper = createSidebarPanel();
assert.isFalse(wrapper.find('Slider').prop('visible'));
assert.isFalse(wrapper.find('Dialog').exists());
});

context('when panel state changes', () => {
Expand Down

0 comments on commit 52b7e70

Please sign in to comment.