Commit 10ed76a8 by Matt Drayer

Merge pull request #10543 from edx/asadiqbal08/SOL-1379_point_to_release

asadiqbal08/SOL-1379 - Removed the limit on the number of lines in a title.
parents 222bdd98 13508c76
...@@ -31,23 +31,6 @@ function(_, str, Backbone, BackboneRelational, gettext) { ...@@ -31,23 +31,6 @@ function(_, str, Backbone, BackboneRelational, gettext) {
return response; return response;
}, },
validate: function(attrs) {
var errors = null;
if(_.has(attrs, 'title')){
var title = attrs.title;
var lines = title.split(/\r\n|\r|\n/);
if (lines.length > 2) {
errors = _.extend({
'title': gettext('Signatory title should span over maximum of 2 lines.')
}, errors);
}
}
if (errors !== null){
return errors;
}
},
setOriginalAttributes: function() { setOriginalAttributes: function() {
// Remember the current state of this model (enables edit->cancel use cases) // Remember the current state of this model (enables edit->cancel use cases)
this._originalAttributes = this.parse(this.toJSON()); this._originalAttributes = this.parse(this.toJSON());
......
...@@ -244,24 +244,6 @@ function(_, Course, CertificatesCollection, CertificateModel, CertificateDetails ...@@ -244,24 +244,6 @@ function(_, Course, CertificatesCollection, CertificateModel, CertificateDetails
this.view.$(SELECTORS.signatory_organization_value) this.view.$(SELECTORS.signatory_organization_value)
).toContainText('New Signatory Test Organization'); ).toContainText('New Signatory Test Organization');
}); });
it('should not allow invalid data when saving changes made during in-line signatory editing', function() {
this.view.$(SELECTORS.edit_signatory).click();
setValuesToInputs(this.view, {
inputSignatoryName: 'New Signatory Test Name'
});
setValuesToInputs(this.view, {
inputSignatoryTitle: 'Signatory Title \non three \nlines'
});
setValuesToInputs(this.view, {
inputSignatoryOrganization: 'New Signatory Test Organization'
});
this.view.$(SELECTORS.signatory_panel_save).click();
expect(this.view.$(SELECTORS.inputSignatoryTitle).parent()).toHaveClass('error');
});
}); });
}); });
}); });
...@@ -246,7 +246,7 @@ function(_, Course, CertificateModel, SignatoryModel, CertificatesCollection, Ce ...@@ -246,7 +246,7 @@ function(_, Course, CertificateModel, SignatoryModel, CertificatesCollection, Ce
expect(this.view.$('.certificate-edit-error')).not.toHaveClass('is-shown'); expect(this.view.$('.certificate-edit-error')).not.toHaveClass('is-shown');
}); });
it('signatories should not save when title span on more than 2 lines', function() { it('signatories should save when title span on more than 2 lines', function() {
this.view.$(SELECTORS.addSignatoryButton).click(); this.view.$(SELECTORS.addSignatoryButton).click();
setValuesToInputs(this.view, { setValuesToInputs(this.view, {
inputCertificateName: 'New Certificate Name' inputCertificateName: 'New Certificate Name'
...@@ -265,7 +265,7 @@ function(_, Course, CertificateModel, SignatoryModel, CertificatesCollection, Ce ...@@ -265,7 +265,7 @@ function(_, Course, CertificateModel, SignatoryModel, CertificatesCollection, Ce
}); });
this.view.$(SELECTORS.saveCertificateButton).click(); this.view.$(SELECTORS.saveCertificateButton).click();
expect(this.view.$('.certificate-edit-error')).toHaveClass('is-shown'); expect(this.view.$('.certificate-edit-error')).not.toHaveClass('is-shown');
}); });
it('user can delete those signatories already saved', function() { it('user can delete those signatories already saved', function() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment