Commit 974338e9 authored by Alejandro Celaya's avatar Alejandro Celaya Committed by Alejandro Celaya

Mock internal sidebar emitter

parent 816a5aae
import { TinyEmitter } from 'tiny-emitter';
import { addConfigFragment } from '../../shared/config-fragment';
import { Sidebar, MIN_RESIZE, $imports } from '../sidebar';
import { EventBus } from '../util/emitter';
import { Emitter, EventBus } from '../util/emitter';
const DEFAULT_WIDTH = 350;
const DEFAULT_HEIGHT = 600;
......@@ -25,6 +27,7 @@ describe('Sidebar', () => {
let FakeToolbarController;
let fakeToolbar;
let fakeSendErrorsTo;
let fakeEmitter;
before(() => {
sinon.stub(window, 'requestAnimationFrame').yields();
......@@ -97,7 +100,7 @@ describe('Sidebar', () => {
document.body.appendChild(container);
containers.push(container);
const eventBus = new EventBus();
const eventBus = { createEmitter: () => fakeEmitter };
const sidebar = new Sidebar(container, eventBus, config);
sidebars.push(sidebar);
......@@ -150,6 +153,8 @@ describe('Sidebar', () => {
fakeSendErrorsTo = sinon.stub();
fakeEmitter = new Emitter(new TinyEmitter());
const fakeCreateAppConfig = sinon.spy((appURL, config) => {
const appConfig = { ...config };
delete appConfig.sidebarAppUrl;
......
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