-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Fix Header (+ Refactor) #1221
Fix Header (+ Refactor) #1221
Conversation
Example app for the last commit (6c4653e): |
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.
Snapshots bro!
Codecov Report
@@ Coverage Diff @@
## next #1221 +/- ##
=========================================
- Coverage 72.26% 71.17% -1.1%
=========================================
Files 33 30 -3
Lines 595 569 -26
Branches 90 84 -6
=========================================
- Hits 430 405 -25
+ Misses 138 137 -1
Partials 27 27
Continue to review full report at Codecov.
|
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.
Compared to the picture we have in the docs |
src/header/__tests__/Header.js
Outdated
@@ -34,13 +35,15 @@ describe('Header Component', () => { | |||
</Header> | |||
); | |||
|
|||
expect(component.find('Button').length).toBe(2); | |||
expect(component.length).toBe(1); | |||
expect(toJson(component)).toMatchSnapshot(); |
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.
Should we be snapshotting here ?. Can we test the actually functionality describe by the test case 😉
should render multiple children when passed in
expect(component.children().length).toBe(2)
or more explicitly
expect(component.find('Button').length).toBe(2)
same with the other cases :)
This reverts commit af7192b.
@iRoachie It's fixed |
@martinezguillaume Mind doing the typescript definitions or you want me to do em? |
@iRoachie I’ll do it, I forgot 🙂 |
Ping @martinezguillaume 🔔 |
|
||
```js | ||
<Header | ||
statusBarProps={{ barStyle: 'light-content' }} | ||
barStyle="light-content" // or directly |
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.
@martinezguillaume Any reason you added this?
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.
Because I think it’s a very used props of StatusBar component. So we can use it directly without doing
<Header
statusBarProps={{ barStyle: 'light-content' }}
/>
6e6cdb2
to
3a91c0d
Compare
Ref https://github.com/react-native-training/react-native-elements/pull/1105