(function () { 'use strict'; var ID = 'view/viewmode'; var DEPS = ['_', '$', 'core/event', 'core/resource', 'core/settings', 'view/sidebar', 'view/topbar', 'view/view']; describe('module \'' + ID + '\'', function () { before(function () { this.definition = modulejs._private.definitions[ID]; this.xEvent = { sub: sinon.stub(), pub: sinon.stub() }; this.xResource = { image: sinon.stub().returns(util.uniqPath('-image.png')) }; this.xSettings = {view: { viewmodeToggle: false }}; this.xSidebar = {$el: null}; this.xTopbar = {$el: null}; this.xView = { $el: null, getModes: sinon.stub().returns(['details', 'grid', 'icons']), getMode: sinon.stub(), setMode: sinon.stub(), getSizes: sinon.stub().returns([1, 2]), getSize: sinon.stub(), setSize: sinon.stub() }; this.applyFn = function () { this.xEvent.sub.reset(); this.xEvent.pub.reset(); this.xResource.image.reset(); this.xView.getModes.reset(); this.xView.getMode.reset(); this.xView.setMode.reset(); this.xView.getSizes.reset(); this.xView.getSize.reset(); this.xView.setSize.reset(); return this.definition.fn(_, $, this.xEvent, this.xResource, this.xSettings, this.xSidebar, this.xTopbar, this.xView); }; }); after(function () { util.restoreHtml(); }); beforeEach(function () { util.restoreHtml(); this.xSidebar.$el = $('