test: Added tests for auth reducer and refactored some other tests#579
test: Added tests for auth reducer and refactored some other tests#579andrewda merged 6 commits intogitpoint:masterfrom
Conversation
andrewda
left a comment
There was a problem hiding this comment.
End tests in .js, not .spec.js. Besides that looks good.
|
Also - don't end data files in |
|
There's a lot of data in |
|
I'll rename those files, yeah it's quite a bit of data; I just took the GitHub example responses verbatim from the API docs. Since the file isn't used in a build is it a good idea to just keep data as a copy of the example responses incase it ever needs to be changed? |
|
@andrewda done. What's the reasoning behind not using |
|
@jglover Several reasons: 1) when I began adding tests, I didn't use it, and we've stayed consistent with that, 2) everything's already in a single |
alejandronanez
left a comment
There was a problem hiding this comment.
Besides @andrewda changes. LGTM
src/utils/localization-helper.js
Outdated
| export const getLocale = () => { | ||
| const locale = I18n.locale.toLowerCase(); | ||
| // If for some reason a locale cannot be determined, fall back to 'en'. | ||
| const locale = (I18n.locale && I18n.locale.toLowerCase()) || 'en'; |
There was a problem hiding this comment.
@jglover Please read en from src/config/common, as well as the comment.
|
@andrewda Anything left outstanding? Keen to get this merged before it gets conflicts. |
src/utils/localization-helper.js
Outdated
| export const getLocale = () => { | ||
| const locale = I18n.locale.toLowerCase(); | ||
| // If for some reason a locale cannot be determined, fall back to 'en'. | ||
| const locale = (I18n.locale && I18n.locale.toLowerCase()) || 'en'; |
There was a problem hiding this comment.
@jglover Please read en from src/config/common, as well as the comment.
Adds test for auth reducer and refactoring.
Also adds default fallback for 'en' inside
localization-helperincase location cannot be determined/promise to get locale inapp.jshas not fulfilled yet and somehow user has navigated, requiring a value (this was breaking unit tests).