-
Notifications
You must be signed in to change notification settings - Fork 320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
:Bug: Fix bundle in sign in widget. #313
:Bug: Fix bundle in sign in widget. #313
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me.
Can you test this with an override? Meaning a key that is passed in the config for other language
Tried this with the following config. baseUrl: 'http://rain.okta1.com:1802',
logo: '/img/logo_widgico.png',
logoText: 'Windico',
i18n: {
fr: {
'primaryauth.title': 'French Sign in'
}
},
features: {
router: true,
rememberMe: true,
multiOptionalFactorEnroll: true
},
// Host the assets (i.e. jsonp files) locally
assets: {
baseUrl: '/'
} |
Please try it as well with an override of a string that is defined in courage bundle |
@mauriciocastillosilva-okta @hor-kanchan-okta added a few unit tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the tests. Just minor comments see if we can reuse functions we already have.
test/unit/helpers/dom/Form.js
Outdated
@@ -6,6 +6,10 @@ define(['okta/jquery', 'okta/underscore', './Dom'], function ($, _, Dom) { | |||
return this.el('o-form-head').trimmedText(); | |||
}, | |||
|
|||
errorBannerText: function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you use any of the error functions we already have? I think errorMessage
should work, but we also have hasErrors
, errorBox
and error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. I'll update the test
@@ -3,6 +3,7 @@ define({ | |||
'responseType': 'json', | |||
'response': { | |||
'enroll.call.setup': 'JA: enroll.call.setup', | |||
'security.disliked_food': 'JA: What is the food you least liked as a child?' | |||
'security.disliked_food': 'JA: What is the food you least liked as a child?', | |||
'oform.errorbanner.title': 'Japanese error banner title' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this need the JA:
prefix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need the JA prefix. My goal for this test is just to make sure that I am validating the text value for the key oform.errorbanner.title
that is coming from login_ja file. Essentially mocking the behavior we get when we have bundles.login loaded with japanese translations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, I think it's more for consistency with the other strings we have... JA: oform.errorbanner.title
, but I guess it is more a nit than anything else.
@mauriciocastillosilva-okta updated tests |
2184443
to
c685b6e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nits. Fix those and ⛵️
@@ -3,6 +3,7 @@ define({ | |||
'responseType': 'json', | |||
'response': { | |||
'enroll.call.setup': 'JA: enroll.call.setup', | |||
'security.disliked_food': 'JA: What is the food you least liked as a child?' | |||
'security.disliked_food': 'JA: What is the food you least liked as a child?', | |||
'oform.errorbanner.title': 'Japanese error banner title' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, I think it's more for consistency with the other strings we have... JA: oform.errorbanner.title
, but I guess it is more a nit than anything else.
test/unit/spec/LoginRouter_spec.js
Outdated
@@ -975,6 +975,48 @@ function (Okta, Q, Backbone, SharedUtil, CryptoUtil, CookieUtil, Logger, OktaAut | |||
expect(test.form.selectedCountry()).toBe('Nihon'); | |||
}); | |||
}); | |||
|
|||
itp('overrides text for keys in courage bundle for non english languages', function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: overrides text in the courage bundle for non English language
test/unit/spec/LoginRouter_spec.js
Outdated
}); | ||
}); | ||
|
||
itp('Text for keys in courage bundle are in jp as set in settings.language', function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Strings in courage bundle are in jp as set in settings.language
test/unit/spec/LoginRouter_spec.js
Outdated
}); | ||
}); | ||
|
||
itp('Text for keys in courage bundle are in en as set in settings.language', function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be make more sense as Strings in courage bundle are in English by default
and remove the settings
object. Thinking because we already tested that a specific language works in the test above (jp)
c685b6e
to
b089217
Compare
@mauriciocastillosilva-okta address nits with the last commit. |
🏎 |
@mauriciocastillosilva-okta @hor-kanchan-okta @rchild-okta
@upteam-okta
Test by changing browser language