-
Notifications
You must be signed in to change notification settings - Fork 10
chore: aselo-webhcat-react-app - fix unit tests [CHI-3624] #3829
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
base: gian_CHI-3613
Are you sure you want to change the base?
Conversation
| (localeTranslations: ConfigState['translations'][keyof ConfigState['translations']]) => | ||
| (key: string, parameters: Record<string, string> = {}) => { | ||
| const lookedUpValue = localeTranslations[key] || key; | ||
| const lookedUpValue = (localeTranslations && localeTranslations[key]) || key; |
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.
The translations should always be present with the merged configs
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.
I know they should but if they don't I'm of the idea is better to have a weird default than a blank page. Also, this way makes testing easier, as we need less mocks.
| import { initLogger, getLogger } from './logger'; | ||
| import { changeExpandedStatus } from './store/actions/genericActions'; | ||
|
|
||
| const getHelplineConfig = async ({ configUrl }: { configUrl: string | URL }) => { |
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 logic seemed more concise and readable inline, especially considering all the result type bloat the separate function adds
A comment indicating that the section of code loads the config would be better than moving it out to a function. Internal functions that are only called from one place generally don't help readability - better to have it inline, commented as appropriate - though there are exceptions
Description
This PR
Checklist
Verification steps
AFTER YOU MERGE
You are responsible for ensuring the above steps are completed. If you move a ticket into QA without advising what version to test, the QA team will assume the latest tag has the changes. If it does not, the following confusion is on you! :-P