Tests space-before-function-paren

This commit is contained in:
Amine Ben hammou
2017-09-27 15:41:06 +00:00
parent bb8591a67b
commit 68165b7b78
20 changed files with 202 additions and 203 deletions

View File

@ -8,7 +8,7 @@ define([
'newsletter_editor/components/communication',
'newsletter_editor/blocks/posts',
'newsletter_editor/blocks/container'
], function(App, Communication, PostsBlock, ContainerBlock) {
], function (App, Communication, PostsBlock, ContainerBlock) {
var EditorApplication = App;
var CommunicationComponent = Communication;
@ -24,8 +24,8 @@ define([
describe('model', function () {
var model;
before(function() {
CommunicationComponent.getPosts = function() {
before(function () {
CommunicationComponent.getPosts = function () {
var deferred = jQuery.Deferred();
return deferred;
};
@ -238,7 +238,7 @@ define([
});
it('triggers loading and loaded events for more posts', function () {
var stub = sinon.stub(CommunicationComponent, 'getPosts', function() {
var stub = sinon.stub(CommunicationComponent, 'getPosts', function () {
var deferred = jQuery.Deferred();
deferred.resolve([{}]); // 1 post
return deferred;
@ -291,7 +291,7 @@ define([
var view;
before(function () {
CommunicationComponent.getPostTypes = function() {
CommunicationComponent.getPostTypes = function () {
var deferred = jQuery.Deferred();
deferred.resolve([
{
@ -423,10 +423,10 @@ define([
expect(model.get('readMoreText')).to.equal(newValue);
});
describe('when "title only" display type is selected', function() {
describe('when "title only" display type is selected', function () {
var model;
var view;
beforeEach(function() {
beforeEach(function () {
model = new (PostsBlock.PostsBlockModel)();
model.request = sinon.stub().returns({$el: {}});
view = new (PostsBlock.PostsBlockSettingsView)({model: model});
@ -438,8 +438,8 @@ define([
expect(view.$('.mailpoet_posts_title_as_list')).to.not.have.$class('mailpoet_hidden');
});
describe('when "title as list" is selected', function() {
beforeEach(function() {
describe('when "title as list" is selected', function () {
beforeEach(function () {
view.$('.mailpoet_posts_display_type').val('titleOnly').change();
view.$('.mailpoet_posts_title_format').val('ul').change();
});
@ -449,14 +449,14 @@ define([
expect(view.$('.mailpoet_posts_title_as_link')).to.have.$class('mailpoet_hidden');
});
it('is set to "yes"', function() {
it('is set to "yes"', function () {
expect(model.get('titleIsLink')).to.equal(true);
});
});
});
describe('when "title as list" is deselected', function() {
before(function() {
describe('when "title as list" is deselected', function () {
before(function () {
view.$('.mailpoet_posts_title_format').val('ul').change();
view.$('.mailpoet_posts_title_format').val('h3').change();
});