Display ALC warning

[MAILPOET-1631]
This commit is contained in:
Pavel Dohnal
2018-11-13 12:32:58 +01:00
parent 19d13c5165
commit 13d35c4385
2 changed files with 8 additions and 8 deletions

View File

@ -266,7 +266,6 @@ define([
},
validateNewsletter: function (jsonObject) {
var body = '';
var contents;
if (!App._contentContainer.isValid()) {
this.showValidationError(App._contentContainer.validationError);
return;
@ -282,10 +281,9 @@ define([
return;
}
contents = JSON.stringify(jsonObject);
if ((App.getNewsletter().get('type') === 'notification') &&
contents.indexOf('"type":"automatedLatestContent"') < 0 &&
contents.indexOf('"type":"automatedLatestContentLayout"') < 0
body.indexOf('"type":"automatedLatestContent"') < 0 &&
body.indexOf('"type":"automatedLatestContentLayout"') < 0
) {
this.showValidationError(MailPoet.I18n.t('automatedLatestContentMissing'));
return;

View File

@ -129,11 +129,13 @@ define([
var newsletter = { get: sinon.stub().withArgs('type').returns('notification') };
EditorApplication.getNewsletter = sinon.stub().returns(newsletter);
view.validateNewsletter({
body: {
content: {
blocks: [
{ type: 'automatedLatestContent' }
]
}
}
});
expect(hideValidationErrorStub.callCount).to.be.equal(1);
});