Fix no-param-reassign in tests

[MAILPOET-1033]
This commit is contained in:
Pavel Dohnal
2017-08-16 12:34:59 +02:00
parent bac494ac0d
commit eaf10e8a96
15 changed files with 38 additions and 24 deletions

View File

@ -55,20 +55,21 @@ jQuery.fn.stick_in_parent = function() { return this; };
// Add global stubs for convenience
// TODO: Extract those to a separate file
global.stubChannel = function (EditorApplication, returnObject) {
EditorApplication.getChannel = sinon.stub().returns(_.defaults(returnObject || {}, {
var App = EditorApplication;
App.getChannel = sinon.stub().returns(_.defaults(returnObject || {}, {
trigger: function () {
},
on: function () {
}
}));
};
global.stubConfig = function (EditorApplication, config) {
config = config || {};
EditorApplication.getConfig = sinon.stub().returns(new Backbone.SuperModel(config));
global.stubConfig = function (EditorApplication, opts) {
var App = EditorApplication;
App.getConfig = sinon.stub().returns(new Backbone.SuperModel(opts || {}));
};
global.stubAvailableStyles = function (EditorApplication, styles) {
styles = styles || {};
EditorApplication.getAvailableStyles = sinon.stub().returns(new Backbone.SuperModel(styles));
var App = EditorApplication;
App.getAvailableStyles = sinon.stub().returns(new Backbone.SuperModel(styles || {}));
};
global.stubImage = function(defaultWidth, defaultHeight) {