Fix eslint no-unused-expressions in tests
[MAILPOET-1085]
This commit is contained in:
@@ -19,7 +19,6 @@
|
||||
"max-len": 0,
|
||||
"space-unary-ops": 0,
|
||||
"no-unused-vars": 0,
|
||||
"no-unused-expressions": 0,
|
||||
"no-underscore-dangle": 0,
|
||||
"no-shadow": 0,
|
||||
"padded-blocks": 0,
|
||||
|
@@ -236,4 +236,4 @@ global.templates = {
|
||||
textInsertion: Handlebars.compile(jQuery('#newsletter_editor_template_text_widget').html()),
|
||||
textBlockSettings: Handlebars.compile(jQuery('#newsletter_editor_template_text_settings').html())
|
||||
};
|
||||
global.window.templates = global.templates;
|
||||
global.window.templates = global.templates;
|
||||
|
@@ -307,7 +307,7 @@ define([
|
||||
});
|
||||
|
||||
it('listens to the event', function () {
|
||||
expect(onStub).to.have.been.calledOnce;
|
||||
expect(onStub).to.have.been.callCount(1);
|
||||
expect(onStub).to.have.been.calledWith('replaceAllButtonStyles', sinon.match.func);
|
||||
});
|
||||
|
||||
@@ -321,7 +321,7 @@ define([
|
||||
}
|
||||
};
|
||||
callback(data);
|
||||
expect(model.set).to.have.been.calledOnce;
|
||||
expect(model.set).to.have.been.callCount(1);
|
||||
expect(model.set).to.have.been.calledWithMatch(sinon.match.has('readMoreButton', data));
|
||||
});
|
||||
});
|
||||
|
@@ -276,7 +276,7 @@ define([
|
||||
});
|
||||
|
||||
it('listens to the event', function () {
|
||||
expect(onStub).to.have.been.calledOnce;
|
||||
expect(onStub).to.have.been.callCount(1);
|
||||
expect(onStub).to.have.been.calledWith('replaceAllButtonStyles', sinon.match.func);
|
||||
});
|
||||
|
||||
@@ -290,7 +290,7 @@ define([
|
||||
}
|
||||
};
|
||||
callback(data);
|
||||
expect(model.set).to.have.been.calledOnce;
|
||||
expect(model.set).to.have.been.callCount(1);
|
||||
expect(model.set).to.have.been.calledWithExactly(data);
|
||||
});
|
||||
});
|
||||
|
@@ -254,8 +254,8 @@ define([
|
||||
stub.restore();
|
||||
spy.restore();
|
||||
|
||||
expect(spy.withArgs('loadingMorePosts').calledOnce).to.be.true;
|
||||
expect(spy.withArgs('morePostsLoaded').calledOnce).to.be.true;
|
||||
expect(spy.withArgs('loadingMorePosts').calledOnce).to.be.true;// eslint-disable-line no-unused-expressions
|
||||
expect(spy.withArgs('morePostsLoaded').calledOnce).to.be.true;// eslint-disable-line no-unused-expressions
|
||||
expect(model.get('_availablePosts').length).to.equal(3);
|
||||
});
|
||||
});
|
||||
|
@@ -33,7 +33,8 @@ define([
|
||||
}
|
||||
});
|
||||
module.save();
|
||||
expect(spy.withArgs('beforeEditorSave').calledOnce).to.be.true;
|
||||
expect(spy).to.have.callCount(1);
|
||||
expect(spy).to.have.been.calledWith('beforeEditorSave');
|
||||
});
|
||||
|
||||
it('triggers afterEditorSave event', function() {
|
||||
@@ -54,7 +55,7 @@ define([
|
||||
});
|
||||
promise.resolve({ success: true });
|
||||
module.save();
|
||||
expect(spy.withArgs('afterEditorSave').calledOnce).to.be.true;
|
||||
expect(spy.withArgs('afterEditorSave').calledOnce).to.be.true;// eslint-disable-line no-unused-expressions
|
||||
});
|
||||
|
||||
it('sends newsletter json to server for saving', function() {
|
||||
@@ -188,7 +189,8 @@ define([
|
||||
view.render();
|
||||
|
||||
view.$('.mailpoet_save_next').click();
|
||||
expect(spy.withArgs('beforeEditorSave').calledOnce).to.be.true;
|
||||
expect(spy).to.have.callCount(1);
|
||||
expect(spy).to.have.been.calledWith('beforeEditorSave');
|
||||
});
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user