Skip to content

uilib-test-renderer - some fixes to findStyle #1602

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 3 commits into from
Oct 19, 2021

Conversation

M-i-k-e-l
Copy link
Collaborator

Description

uilib-test-renderer - some fixes to findStyle.

  1. The const is renamed from color to value (more general).
  2. Change find to findLast (the last style is the one in affect).
  3. Protect from undefined.

Changelog

uilib-test-renderer - some fixes to findStyle (testing infra)

@M-i-k-e-l
Copy link
Collaborator Author

@mendyEdri it looks like there's a bug in the hint/index.spec.js, you've specified color={Colors.white}, and so the background color will be white and not primary; you can test it by putting the following in the PlaygroundScreen (remove the commented lines as needed):

<Hint
  visible
  message={'Hint message to hint things'}
  position={Hint.positions.TOP}
  useSideTip
  key={'1'}
  targetFrame={{x: 10, y: 200, height: 1, width: 1}}
  onBackgroundPress={() => {}}
  // color={Colors.white}
  // removePaddings
  enableShadow
  testID={'Hint'}
/>

Should I remove the background color or change the expected result?

@mendyEdri
Copy link
Contributor

@mendyEdri it looks like there's a bug in the hint/index.spec.js, you've specified color={Colors.white}, and so the background color will be white and not primary; you can test it by putting the following in the PlaygroundScreen (remove the commented lines as needed):

<Hint
  visible
  message={'Hint message to hint things'}
  position={Hint.positions.TOP}
  useSideTip
  key={'1'}
  targetFrame={{x: 10, y: 200, height: 1, width: 1}}
  onBackgroundPress={() => {}}
  // color={Colors.white}
  // removePaddings
  enableShadow
  testID={'Hint'}
/>

Should I remove the background color or change the expected result?

@M-i-k-e-l Yes, technically you can, I'm not sure if I wanted to make sure the backgroundColor can be change or not.

@M-i-k-e-l
Copy link
Collaborator Author

@M-i-k-e-l Yes, technically you can, I'm not sure if I wanted to make sure the backgroundColor can be change or not.

Let me know if my change is ok

@M-i-k-e-l M-i-k-e-l requested a review from mendyEdri October 18, 2021 12:59
@mendyEdri mendyEdri merged commit 633ef42 into master Oct 19, 2021
@M-i-k-e-l M-i-k-e-l deleted the fix/uilib-test-renderer-find-style branch October 19, 2021 09:39
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