Navigation Menu

Skip to content

Commit

Permalink
🐛 Fix issue with custom string overrides in registration form. (#535)
Browse files Browse the repository at this point in the history
- Fixes issue with custom string overrides in registration form.

Resolves: OKTA-185215
  • Loading branch information
nikhilvenkatraman-okta committed Sep 6, 2018
1 parent b566b10 commit 911edcf
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/RegistrationController.js
Expand Up @@ -58,14 +58,6 @@ function (
}
});

var Form = Okta.Form.extend({
layout: 'o-form-theme',
autoSave: true,
noCancelButton: true,
title: Okta.loc('registration.form.title', 'login'),
save: Okta.loc('registration.form.submit', 'login')
});

return BaseLoginController.extend({
className: 'registration',
initialize: function() {
Expand Down Expand Up @@ -190,6 +182,13 @@ function (
// create model
self.model = self.createRegistrationModel(modelProperties);
// create form
var Form = Okta.Form.extend({
layout: 'o-form-theme',
autoSave: true,
noCancelButton: true,
title: Okta.loc('registration.form.title', 'login'),
save: Okta.loc('registration.form.submit', 'login')
});
var form = new Form(self.toJSON());
// add form
self.add(form);
Expand Down
24 changes: 24 additions & 0 deletions test/unit/spec/Registration_spec.js
Expand Up @@ -143,11 +143,35 @@ function (Q, _, $, OktaAuth, Backbone, Util, Expect, Beacon, RegForm, RegSchema,
expect(test.form.titleText()).toEqual('Create Account');
});
});
itp('uses custom title', function () {
var config = {
'i18n': {
'en': {
'registration.form.title': 'Custom Form Title'
}
}
};
return setup(config).then(function (test) {
expect(test.form.titleText()).toEqual('Custom Form Title');
});
});
itp('uses default for submit', function () {
return setup().then(function (test) {
expect(test.form.submitButtonText()).toEqual('Register');
});
});
itp('uses custom text for submit', function () {
var config = {
'i18n': {
'en': {
'registration.form.submit': 'Custom Register Button'
}
}
};
return setup(config).then(function (test) {
expect(test.form.submitButtonText()).toEqual('Custom Register Button');
});
});
itp('policyid is retrieved from default org policy', function () {
return setup().then(function (test) {
test.form.setUserName('test@example.com');
Expand Down

0 comments on commit 911edcf

Please sign in to comment.