fixing js tests
This commit is contained in:
@@ -93,18 +93,16 @@ define([
|
|||||||
};
|
};
|
||||||
|
|
||||||
Module.saveTemplate = function (options) {
|
Module.saveTemplate = function (options) {
|
||||||
var categories = [
|
var promise = jQuery.Deferred();
|
||||||
'saved',
|
|
||||||
App.getNewsletter().get('type')
|
|
||||||
];
|
|
||||||
|
|
||||||
return Module.getThumbnail(
|
promise.then(function (thumbnail) {
|
||||||
jQuery('#mailpoet_editor_content > .mailpoet_block').get(0)
|
|
||||||
).then(function (thumbnail) {
|
|
||||||
var data = _.extend(options || {}, {
|
var data = _.extend(options || {}, {
|
||||||
thumbnail: thumbnail.toDataURL('image/jpeg'),
|
thumbnail: thumbnail.toDataURL('image/jpeg'),
|
||||||
body: JSON.stringify(App.getBody()),
|
body: JSON.stringify(App.getBody()),
|
||||||
categories: JSON.stringify(categories)
|
categories: JSON.stringify([
|
||||||
|
'saved',
|
||||||
|
App.getNewsletter().get('type')
|
||||||
|
])
|
||||||
});
|
});
|
||||||
|
|
||||||
return MailPoet.Ajax.post({
|
return MailPoet.Ajax.post({
|
||||||
@@ -114,6 +112,14 @@ define([
|
|||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Module.getThumbnail(
|
||||||
|
jQuery('#mailpoet_editor_content > .mailpoet_block').get(0)
|
||||||
|
).then(function (thumbnail) {
|
||||||
|
promise.resolve(thumbnail);
|
||||||
|
});
|
||||||
|
|
||||||
|
return promise;
|
||||||
};
|
};
|
||||||
|
|
||||||
Module.exportTemplate = function (options) {
|
Module.exportTemplate = function (options) {
|
||||||
|
@@ -143,6 +143,13 @@ define([
|
|||||||
});
|
});
|
||||||
|
|
||||||
EditorApplication.getBody = sinon.stub();
|
EditorApplication.getBody = sinon.stub();
|
||||||
|
EditorApplication.getNewsletter = function () {
|
||||||
|
return {
|
||||||
|
get: function () {
|
||||||
|
return 'standard';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
module = SaveInjector({
|
module = SaveInjector({
|
||||||
mailpoet: {
|
mailpoet: {
|
||||||
Ajax: {
|
Ajax: {
|
||||||
|
Reference in New Issue
Block a user