describe('Courseware', function() { describe('start', () => it('binds the Logger', function() { spyOn(Logger, 'bind'); Courseware.start(); expect(Logger.bind).toHaveBeenCalled(); }) ); describe('render', function() { beforeEach(function() { jasmine.stubRequests(); this.courseware = new Courseware; spyOn(window, 'Histogram'); spyOn(window, 'Problem'); spyOn(window, 'Video'); spyOn(XBlock, 'initializeBlocks'); setFixtures(`\
\ ` ); this.courseware.render(); }); it('ensure that the XModules have been loaded', () => expect(XBlock.initializeBlocks).toHaveBeenCalled()); it('detect the histrogram element and convert it', () => expect(window.Histogram).toHaveBeenCalledWith('3', [[0, 1]])); }); });