-
Notifications
You must be signed in to change notification settings - Fork 734
WheelPicker - render tests #1688
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
Conversation
@lidord-wix I'm waiting for this PR to add another render test for my bug fix. Can you please make this a priority? |
src/uilib-test-renderer/helper.ts
Outdated
@@ -12,4 +13,8 @@ const findStyle = <T>(key: string, component: Component): T => { | |||
return StyleSheet.flatten(component.props.style)[key]; | |||
}; | |||
|
|||
export {findStyle}; | |||
const FireOnMomentumScrollEnd = (component: any, {x, y}: {x?: number, y?: number}) => { |
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.
You need to use lower case for functions.
Also, 'helper' is a very general file. I would move this to a scrollView helper file.
The 'nativeEvent' configuration I would move to a separate function, as you might add more helper functions that will need it, like 'onScroll'.
|
||
//TODO: make this test work | ||
// describe('Item', () => { | ||
// it('should color selected index with activeColor', () => { |
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 description is not very clear on what you want to test (where is the verb in this sentence?)
numberOfVisibleRows={NUM_OF_ROWS} | ||
itemHeight={ITEM_HEIGHT} | ||
initialIndex={0} | ||
activeTextColor={'red'} |
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.
Please use uilib colors (Color.red30, Colors.blue30)
|
||
FireOnMomentumScrollEnd(flatList, {y: 200}); | ||
|
||
expect(onChangeMock).toHaveBeenCalled(); |
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 is a redundant test as the next test coves it already.
Description
Enter description to help the reviewer understand what's the change about...
Changelog
Add a quick message for our users about this change (include Compoennt name, relevant props and general purpose of the PR)