Skip to content

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

Merged
merged 5 commits into from
Dec 1, 2021
Merged

WheelPicker - render tests #1688

merged 5 commits into from
Dec 1, 2021

Conversation

lidord-wix
Copy link
Contributor

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)

@Inbal-Tish
Copy link
Collaborator

@lidord-wix I'm waiting for this PR to add another render test for my bug fix. Can you please make this a priority?

@lidord-wix lidord-wix marked this pull request as ready for review November 30, 2021 16:08
@@ -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}) => {
Copy link
Collaborator

@Inbal-Tish Inbal-Tish Dec 1, 2021

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', () => {
Copy link
Collaborator

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'}
Copy link
Collaborator

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();
Copy link
Collaborator

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.

@lidord-wix lidord-wix requested a review from Inbal-Tish December 1, 2021 08:10
@Inbal-Tish Inbal-Tish merged commit 58f878d into master Dec 1, 2021
@lidord-wix lidord-wix deleted the Infra/wheelPickerRenderTests branch January 5, 2022 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants