-
Notifications
You must be signed in to change notification settings - Fork 2
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
Feature/disable and enabled props #640
base: master
Are you sure you want to change the base?
Conversation
47c7149
to
0d6d6d1
Compare
0d6d6d1
to
cf67f6a
Compare
@@ -35,7 +35,7 @@ import { | |||
} from '../../actions'; | |||
|
|||
import { | |||
checkVisibility, | |||
referAndGetBool, |
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.
Does 'refer' in this method name refer to doctor referral? Slightly unclear what this method does...
return null; | ||
} | ||
|
||
// Translate "disabled" and "enabled" prop to boolean value |
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.
Maybe it is more appropriate to name something like checkEnabledToBool? (as it seems its main purpose is for check disable/enable -> bool output)
expect(checkVisibility(state, 'root', 'foo:aaa')).toBe(true); | ||
expect(checkVisibility(state, 'root', 'foo:bbb')).toBe(false); | ||
expect(referAndGetBool(state, 'root', 'foo:aaa')).toBe(true); | ||
expect(referAndGetBool(state, 'root', 'foo:bbb')).toBe(false); | ||
}); | ||
|
||
it('handles an empty array as falthy', () => { |
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.
falthy -> falsy
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.
Good and thorough test case.
However, property name orgProp & method name referAndGetBool are hard to understand the meaning of in the business logic.
Please consider clarification or different namings.
<DynamicForm />
andreferAndGetBool
(renamed fromcheckVisibility
) to be able to handledisabled
andenabled
props which controlsdisabled
state of each form field component.