tests: quote-props
This commit is contained in:
committed by
pavel-mailpoet
parent
d181bde0e9
commit
6f149e3ec4
@ -30,7 +30,6 @@
|
|||||||
"no-unused-vars": 0,
|
"no-unused-vars": 0,
|
||||||
"no-unused-expressions": 0,
|
"no-unused-expressions": 0,
|
||||||
"no-underscore-dangle": 0,
|
"no-underscore-dangle": 0,
|
||||||
"quote-props": 0,
|
|
||||||
"no-shadow": 0,
|
"no-shadow": 0,
|
||||||
"padded-blocks": 0,
|
"padded-blocks": 0,
|
||||||
"vars-on-top": 0,
|
"vars-on-top": 0,
|
||||||
|
@ -80,10 +80,10 @@ global.stubImage = function(defaultWidth, defaultHeight) {
|
|||||||
this.address = '';
|
this.address = '';
|
||||||
|
|
||||||
Object.defineProperty(this, 'src', {
|
Object.defineProperty(this, 'src', {
|
||||||
'get': function() {
|
get: function() {
|
||||||
return this.address;
|
return this.address;
|
||||||
},
|
},
|
||||||
'set': function(src) {
|
set: function(src) {
|
||||||
this.address = src;
|
this.address = src;
|
||||||
this.onload();
|
this.onload();
|
||||||
}
|
}
|
||||||
|
@ -90,15 +90,15 @@ define([
|
|||||||
global.stubChannel(EditorApplication);
|
global.stubChannel(EditorApplication);
|
||||||
global.stubAvailableStyles(EditorApplication, {
|
global.stubAvailableStyles(EditorApplication, {
|
||||||
socialIconSets: {
|
socialIconSets: {
|
||||||
'default': {
|
default: {
|
||||||
'custom': 'http://www.sott.net/images/icons/big_x.png'
|
custom: 'http://www.sott.net/images/icons/big_x.png'
|
||||||
},
|
},
|
||||||
'light': {
|
light: {
|
||||||
'custom': 'http://content.indiainfoline.com/wc/news/ImageGallery/css/close_32x32.png'
|
custom: 'http://content.indiainfoline.com/wc/news/ImageGallery/css/close_32x32.png'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
socialIcons: {
|
socialIcons: {
|
||||||
'custom': {
|
custom: {
|
||||||
title: 'Custom',
|
title: 'Custom',
|
||||||
linkFieldName: 'Page URL',
|
linkFieldName: 'Page URL',
|
||||||
defaultLink: 'http://example.org'
|
defaultLink: 'http://example.org'
|
||||||
@ -174,15 +174,15 @@ define([
|
|||||||
global.stubChannel(EditorApplication);
|
global.stubChannel(EditorApplication);
|
||||||
global.stubAvailableStyles(EditorApplication, {
|
global.stubAvailableStyles(EditorApplication, {
|
||||||
socialIconSets: {
|
socialIconSets: {
|
||||||
'default': {
|
default: {
|
||||||
'custom': 'someimage.png'
|
custom: 'someimage.png'
|
||||||
},
|
},
|
||||||
'light': {
|
light: {
|
||||||
'custom': 'http://content.indiainfoline.com/wc/news/ImageGallery/css/close_32x32.png'
|
custom: 'http://content.indiainfoline.com/wc/news/ImageGallery/css/close_32x32.png'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
socialIcons: {
|
socialIcons: {
|
||||||
'custom': {
|
custom: {
|
||||||
title: 'Custom',
|
title: 'Custom',
|
||||||
linkFieldName: 'Page URL',
|
linkFieldName: 'Page URL',
|
||||||
defaultLink: 'http://example.org'
|
defaultLink: 'http://example.org'
|
||||||
@ -217,15 +217,15 @@ define([
|
|||||||
global.stubChannel(EditorApplication);
|
global.stubChannel(EditorApplication);
|
||||||
global.stubAvailableStyles(EditorApplication, {
|
global.stubAvailableStyles(EditorApplication, {
|
||||||
socialIconSets: {
|
socialIconSets: {
|
||||||
'default': {
|
default: {
|
||||||
'custom': 'http://www.sott.net/images/icons/big_x.png'
|
custom: 'http://www.sott.net/images/icons/big_x.png'
|
||||||
},
|
},
|
||||||
'light': {
|
light: {
|
||||||
'custom': 'http://content.indiainfoline.com/wc/news/ImageGallery/css/close_32x32.png'
|
custom: 'http://content.indiainfoline.com/wc/news/ImageGallery/css/close_32x32.png'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
socialIcons: {
|
socialIcons: {
|
||||||
'custom': {
|
custom: {
|
||||||
title: 'Custom',
|
title: 'Custom',
|
||||||
linkFieldName: 'Page URL',
|
linkFieldName: 'Page URL',
|
||||||
defaultLink: 'http://example.org'
|
defaultLink: 'http://example.org'
|
||||||
|
@ -7,14 +7,14 @@ define([
|
|||||||
describe('getPostTypes', function() {
|
describe('getPostTypes', function() {
|
||||||
it('fetches post types from the server', function() {
|
it('fetches post types from the server', function() {
|
||||||
var module = CommunicationInjector({
|
var module = CommunicationInjector({
|
||||||
'mailpoet': {
|
mailpoet: {
|
||||||
Ajax: {
|
Ajax: {
|
||||||
post: function() {
|
post: function() {
|
||||||
var deferred = jQuery.Deferred();
|
var deferred = jQuery.Deferred();
|
||||||
deferred.resolve({
|
deferred.resolve({
|
||||||
data: {
|
data: {
|
||||||
'post': 'val1',
|
post: 'val1',
|
||||||
'page': 'val2'
|
page: 'val2'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return deferred;
|
return deferred;
|
||||||
@ -31,15 +31,15 @@ define([
|
|||||||
var deferred = jQuery.Deferred(),
|
var deferred = jQuery.Deferred(),
|
||||||
mock = sinon.mock({ post: function() {} }).expects('post').once().returns(deferred),
|
mock = sinon.mock({ post: function() {} }).expects('post').once().returns(deferred),
|
||||||
module = CommunicationInjector({
|
module = CommunicationInjector({
|
||||||
'mailpoet': {
|
mailpoet: {
|
||||||
Ajax: {
|
Ajax: {
|
||||||
post: mock
|
post: mock
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
deferred.resolve({
|
deferred.resolve({
|
||||||
'post': 'val1',
|
post: 'val1',
|
||||||
'page': 'val2'
|
page: 'val2'
|
||||||
});
|
});
|
||||||
module.getPostTypes();
|
module.getPostTypes();
|
||||||
module.getPostTypes();
|
module.getPostTypes();
|
||||||
@ -54,15 +54,15 @@ define([
|
|||||||
post = function(params) {
|
post = function(params) {
|
||||||
var deferred = jQuery.Deferred();
|
var deferred = jQuery.Deferred();
|
||||||
deferred.resolve({
|
deferred.resolve({
|
||||||
'category': 'val1',
|
category: 'val1',
|
||||||
'post_tag': 'val2'
|
post_tag: 'val2'
|
||||||
});
|
});
|
||||||
return deferred;
|
return deferred;
|
||||||
},
|
},
|
||||||
module;
|
module;
|
||||||
spy = sinon.spy(post);
|
spy = sinon.spy(post);
|
||||||
module = CommunicationInjector({
|
module = CommunicationInjector({
|
||||||
'mailpoet': {
|
mailpoet: {
|
||||||
Ajax: {
|
Ajax: {
|
||||||
post: spy
|
post: spy
|
||||||
}
|
}
|
||||||
@ -75,13 +75,13 @@ define([
|
|||||||
|
|
||||||
it('fetches taxonomies from the server', function() {
|
it('fetches taxonomies from the server', function() {
|
||||||
var module = CommunicationInjector({
|
var module = CommunicationInjector({
|
||||||
'mailpoet': {
|
mailpoet: {
|
||||||
Ajax: {
|
Ajax: {
|
||||||
post: function() {
|
post: function() {
|
||||||
var deferred = jQuery.Deferred();
|
var deferred = jQuery.Deferred();
|
||||||
deferred.resolve({
|
deferred.resolve({
|
||||||
data: {
|
data: {
|
||||||
'category': 'val1'
|
category: 'val1'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return deferred;
|
return deferred;
|
||||||
@ -90,7 +90,7 @@ define([
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
module.getTaxonomies('page').done(function(types) {
|
module.getTaxonomies('page').done(function(types) {
|
||||||
expect(types).to.eql({ 'category': 'val1' });
|
expect(types).to.eql({ category: 'val1' });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -98,13 +98,13 @@ define([
|
|||||||
var deferred = jQuery.Deferred(),
|
var deferred = jQuery.Deferred(),
|
||||||
mock = sinon.mock({ post: function() {} }).expects('post').once().returns(deferred),
|
mock = sinon.mock({ post: function() {} }).expects('post').once().returns(deferred),
|
||||||
module = CommunicationInjector({
|
module = CommunicationInjector({
|
||||||
'mailpoet': {
|
mailpoet: {
|
||||||
Ajax: {
|
Ajax: {
|
||||||
post: mock
|
post: mock
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
deferred.resolve({ 'category': 'val1' });
|
deferred.resolve({ category: 'val1' });
|
||||||
module.getTaxonomies('page');
|
module.getTaxonomies('page');
|
||||||
module.getTaxonomies('page');
|
module.getTaxonomies('page');
|
||||||
|
|
||||||
@ -123,7 +123,7 @@ define([
|
|||||||
var module;
|
var module;
|
||||||
spy = sinon.spy(post);
|
spy = sinon.spy(post);
|
||||||
module = CommunicationInjector({
|
module = CommunicationInjector({
|
||||||
'mailpoet': {
|
mailpoet: {
|
||||||
Ajax: {
|
Ajax: {
|
||||||
post: spy
|
post: spy
|
||||||
}
|
}
|
||||||
@ -138,14 +138,14 @@ define([
|
|||||||
|
|
||||||
it('fetches terms from the server', function() {
|
it('fetches terms from the server', function() {
|
||||||
var module = CommunicationInjector({
|
var module = CommunicationInjector({
|
||||||
'mailpoet': {
|
mailpoet: {
|
||||||
Ajax: {
|
Ajax: {
|
||||||
post: function() {
|
post: function() {
|
||||||
var deferred = jQuery.Deferred();
|
var deferred = jQuery.Deferred();
|
||||||
deferred.resolve({
|
deferred.resolve({
|
||||||
data: {
|
data: {
|
||||||
'term1': 'term1val1',
|
term1: 'term1val1',
|
||||||
'term2': 'term2val2'
|
term2: 'term2val2'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return deferred;
|
return deferred;
|
||||||
@ -154,7 +154,7 @@ define([
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
module.getTerms({ taxonomies: ['category'] }).done(function(types) {
|
module.getTerms({ taxonomies: ['category'] }).done(function(types) {
|
||||||
expect(types).to.eql({ 'term1': 'term1val1', 'term2': 'term2val2' });
|
expect(types).to.eql({ term1: 'term1val1', term2: 'term2val2' });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -162,13 +162,13 @@ define([
|
|||||||
var deferred = jQuery.Deferred(),
|
var deferred = jQuery.Deferred(),
|
||||||
mock = sinon.mock({ post: function() {} }).expects('post').once().returns(deferred),
|
mock = sinon.mock({ post: function() {} }).expects('post').once().returns(deferred),
|
||||||
module = CommunicationInjector({
|
module = CommunicationInjector({
|
||||||
'mailpoet': {
|
mailpoet: {
|
||||||
Ajax: {
|
Ajax: {
|
||||||
post: mock
|
post: mock
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
deferred.resolve({ 'term1': 'term1val1', 'term2': 'term2val2' });
|
deferred.resolve({ term1: 'term1val1', term2: 'term2val2' });
|
||||||
module.getTerms({ taxonomies: ['category'] });
|
module.getTerms({ taxonomies: ['category'] });
|
||||||
module.getTerms({ taxonomies: ['category'] });
|
module.getTerms({ taxonomies: ['category'] });
|
||||||
|
|
||||||
@ -187,7 +187,7 @@ define([
|
|||||||
module;
|
module;
|
||||||
spy = sinon.spy(post);
|
spy = sinon.spy(post);
|
||||||
module = CommunicationInjector({
|
module = CommunicationInjector({
|
||||||
'mailpoet': {
|
mailpoet: {
|
||||||
Ajax: {
|
Ajax: {
|
||||||
post: spy
|
post: spy
|
||||||
}
|
}
|
||||||
@ -206,7 +206,7 @@ define([
|
|||||||
|
|
||||||
it('fetches posts from the server', function() {
|
it('fetches posts from the server', function() {
|
||||||
var module = CommunicationInjector({
|
var module = CommunicationInjector({
|
||||||
'mailpoet': {
|
mailpoet: {
|
||||||
Ajax: {
|
Ajax: {
|
||||||
post: function() {
|
post: function() {
|
||||||
var deferred = jQuery.Deferred();
|
var deferred = jQuery.Deferred();
|
||||||
@ -230,7 +230,7 @@ define([
|
|||||||
var deferred = jQuery.Deferred(),
|
var deferred = jQuery.Deferred(),
|
||||||
mock = sinon.mock({ post: function() {} }).expects('post').once().returns(deferred),
|
mock = sinon.mock({ post: function() {} }).expects('post').once().returns(deferred),
|
||||||
module = CommunicationInjector({
|
module = CommunicationInjector({
|
||||||
'mailpoet': {
|
mailpoet: {
|
||||||
Ajax: {
|
Ajax: {
|
||||||
post: mock
|
post: mock
|
||||||
}
|
}
|
||||||
@ -258,7 +258,7 @@ define([
|
|||||||
module;
|
module;
|
||||||
spy = sinon.spy(post);
|
spy = sinon.spy(post);
|
||||||
module = CommunicationInjector({
|
module = CommunicationInjector({
|
||||||
'mailpoet': {
|
mailpoet: {
|
||||||
Ajax: {
|
Ajax: {
|
||||||
post: spy
|
post: spy
|
||||||
}
|
}
|
||||||
@ -277,7 +277,7 @@ define([
|
|||||||
|
|
||||||
it('fetches transformed posts from the server', function() {
|
it('fetches transformed posts from the server', function() {
|
||||||
var module = CommunicationInjector({
|
var module = CommunicationInjector({
|
||||||
'mailpoet': {
|
mailpoet: {
|
||||||
Ajax: {
|
Ajax: {
|
||||||
post: function() {
|
post: function() {
|
||||||
var deferred = jQuery.Deferred();
|
var deferred = jQuery.Deferred();
|
||||||
@ -301,7 +301,7 @@ define([
|
|||||||
var deferred = jQuery.Deferred(),
|
var deferred = jQuery.Deferred(),
|
||||||
mock = sinon.mock({ post: function() {} }).expects('post').once().returns(deferred),
|
mock = sinon.mock({ post: function() {} }).expects('post').once().returns(deferred),
|
||||||
module = CommunicationInjector({
|
module = CommunicationInjector({
|
||||||
'mailpoet': {
|
mailpoet: {
|
||||||
Ajax: {
|
Ajax: {
|
||||||
post: mock
|
post: mock
|
||||||
}
|
}
|
||||||
|
@ -148,7 +148,7 @@ define([
|
|||||||
|
|
||||||
EditorApplication.getBody = sinon.stub();
|
EditorApplication.getBody = sinon.stub();
|
||||||
var module = SaveInjector({
|
var module = SaveInjector({
|
||||||
'mailpoet': {
|
mailpoet: {
|
||||||
Ajax: {
|
Ajax: {
|
||||||
post: mock
|
post: mock
|
||||||
},
|
},
|
||||||
@ -162,7 +162,7 @@ define([
|
|||||||
trackEvent: function() {}
|
trackEvent: function() {}
|
||||||
},
|
},
|
||||||
'newsletter_editor/App': EditorApplication,
|
'newsletter_editor/App': EditorApplication,
|
||||||
'html2canvas': function() {
|
html2canvas: function() {
|
||||||
return {
|
return {
|
||||||
then: function() { return html2canvasMock; }
|
then: function() { return html2canvasMock; }
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user