Commit da4412f5 authored by Alejandro Celaya's avatar Alejandro Celaya Committed by Alejandro Celaya

Assert on inline mocked event handlers in sidebar

parent 71de7854
...@@ -366,8 +366,12 @@ describe('Sidebar', () => { ...@@ -366,8 +366,12 @@ describe('Sidebar', () => {
describe('on "openNotebook" event', () => { describe('on "openNotebook" event', () => {
it('hides the sidebar', () => { it('hides the sidebar', () => {
const sidebar = createSidebar(); const sidebar = createSidebar();
const eventHandler = sinon.stub();
fakeEmitter.subscribe('openNotebook', eventHandler);
emitSidebarEvent('openNotebook', 'mygroup'); emitSidebarEvent('openNotebook', 'mygroup');
assert.calledWith(eventHandler, 'mygroup');
assert.notEqual(sidebar.iframeContainer.style.visibility, 'hidden'); assert.notEqual(sidebar.iframeContainer.style.visibility, 'hidden');
}); });
}); });
...@@ -384,8 +388,12 @@ describe('Sidebar', () => { ...@@ -384,8 +388,12 @@ describe('Sidebar', () => {
describe('on "openProfile" event', () => { describe('on "openProfile" event', () => {
it('hides the sidebar', () => { it('hides the sidebar', () => {
const sidebar = createSidebar(); const sidebar = createSidebar();
const eventHandler = sinon.stub();
fakeEmitter.subscribe('openProfile', eventHandler);
emitSidebarEvent('openProfile'); emitSidebarEvent('openProfile');
assert.calledOnce(eventHandler);
assert.notEqual(sidebar.iframeContainer.style.visibility, 'hidden'); assert.notEqual(sidebar.iframeContainer.style.visibility, 'hidden');
}); });
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment