Display ALC warning
[MAILPOET-1631]
This commit is contained in:
@ -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;
|
||||
|
@ -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);
|
||||
});
|
||||
|
Reference in New Issue
Block a user