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.
This commit is contained in:
@@ -31,23 +31,6 @@ function(_, str, Backbone, BackboneRelational, gettext) {
|
||||
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() {
|
||||
// Remember the current state of this model (enables edit->cancel use cases)
|
||||
this._originalAttributes = this.parse(this.toJSON());
|
||||
|
||||
@@ -244,24 +244,6 @@ function(_, Course, CertificatesCollection, CertificateModel, CertificateDetails
|
||||
this.view.$(SELECTORS.signatory_organization_value)
|
||||
).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
|
||||
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();
|
||||
setValuesToInputs(this.view, {
|
||||
inputCertificateName: 'New Certificate Name'
|
||||
@@ -265,7 +265,7 @@ function(_, Course, CertificateModel, SignatoryModel, CertificatesCollection, Ce
|
||||
});
|
||||
|
||||
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() {
|
||||
|
||||
Reference in New Issue
Block a user