Display ALC warning
[MAILPOET-1631]
This commit is contained in:
@ -266,7 +266,6 @@ define([
|
|||||||
},
|
},
|
||||||
validateNewsletter: function (jsonObject) {
|
validateNewsletter: function (jsonObject) {
|
||||||
var body = '';
|
var body = '';
|
||||||
var contents;
|
|
||||||
if (!App._contentContainer.isValid()) {
|
if (!App._contentContainer.isValid()) {
|
||||||
this.showValidationError(App._contentContainer.validationError);
|
this.showValidationError(App._contentContainer.validationError);
|
||||||
return;
|
return;
|
||||||
@ -282,10 +281,9 @@ define([
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
contents = JSON.stringify(jsonObject);
|
|
||||||
if ((App.getNewsletter().get('type') === 'notification') &&
|
if ((App.getNewsletter().get('type') === 'notification') &&
|
||||||
contents.indexOf('"type":"automatedLatestContent"') < 0 &&
|
body.indexOf('"type":"automatedLatestContent"') < 0 &&
|
||||||
contents.indexOf('"type":"automatedLatestContentLayout"') < 0
|
body.indexOf('"type":"automatedLatestContentLayout"') < 0
|
||||||
) {
|
) {
|
||||||
this.showValidationError(MailPoet.I18n.t('automatedLatestContentMissing'));
|
this.showValidationError(MailPoet.I18n.t('automatedLatestContentMissing'));
|
||||||
return;
|
return;
|
||||||
|
@ -129,11 +129,13 @@ define([
|
|||||||
var newsletter = { get: sinon.stub().withArgs('type').returns('notification') };
|
var newsletter = { get: sinon.stub().withArgs('type').returns('notification') };
|
||||||
EditorApplication.getNewsletter = sinon.stub().returns(newsletter);
|
EditorApplication.getNewsletter = sinon.stub().returns(newsletter);
|
||||||
view.validateNewsletter({
|
view.validateNewsletter({
|
||||||
|
body: {
|
||||||
content: {
|
content: {
|
||||||
blocks: [
|
blocks: [
|
||||||
{ type: 'automatedLatestContent' }
|
{ type: 'automatedLatestContent' }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
expect(hideValidationErrorStub.callCount).to.be.equal(1);
|
expect(hideValidationErrorStub.callCount).to.be.equal(1);
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user