-
Notifications
You must be signed in to change notification settings - Fork 10
Conversation
@@ -53,7 +53,7 @@ exports[`Badge should return content inside container if title not provided 1`] | |||
</div> | |||
`; | |||
|
|||
exports[`Badge should return noscript if children and title not provided 1`] = `<noscript />`; | |||
exports[`Badge should return noscript if children and title not provided 1`] = `""`; |
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 could test return null
cases without snapshot. Just do this: expect(component.type()).toEqual(null);
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.
Oh, I see you changed that. So that way should work here as well, right?
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.
Added assertion to verify that it returns null
.
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.
Cool, thanks! ...but do we still really need to compare to snapshot? I would suggest to not create snapshots in these cases and just check the type()
/html()
. How do you think guys?
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.
Strangely, the type()
did not work... Don't know why, though.
Regarding the comparison to the snapshot... Well, for the null
cases I guess no.
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.
Removed
@@ -39,6 +40,6 @@ export default class CalendarWrapper extends React.Component { | |||
} | |||
|
|||
CalendarWrapper.propTypes = { | |||
initialDates: React.PropTypes.arrayOf(String), | |||
minDate: React.PropTypes.string, | |||
initialDates: PropTypes.arrayOf(String), |
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.
Not part of your changes but this can't be right, right?
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 mean the fact that we have propTypes on a wrapper/mock or the fact that I ordered the propTypes?
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.
arrayOf(String)
should be arrayOf(PropTypes.string)
. The first one will basically accept an array of truthy values.
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.
@reaktivo I think the arrayOf
receives the Constructor/Type. How would you do with a custom class/Component? PropTypes.MyComponent
?
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.
Ahh screw it, I do think this is supported, but anyway... Changing 🙄
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.
Now I got it... It's not a PropType checker... just a constructor ... I thought the arrayOf would do (internally) value instanceof ConstructorThatWasPassedInTheArrayOf
.
Codecov Report
@@ Coverage Diff @@
## master #231 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 41 41
Lines 1051 1051
Branches 261 261
=====================================
Hits 1051 1051
Continue to review full report at Codecov.
|
e15eae6
to
710a2e9
Compare
…Replaces enzyme-adapter-react-15 with enzyme-adapter-react-16. Updates Jest to 21.3.0-beta to get a fix for the rAF warning
…places the usage of enzyme-adapter-react-15 for enzyme-adapter-react-16
… Updates snapshots. Removes the usage of React.PropTypes in favour of 'prop-types' one
….spec. Updates the snapshots too
…ovided and the badge is not visible
5b597d7
to
0d113d2
Compare
@mAiNiNfEcTiOn should we delete branch? |
What does this PR do:
enzyme-adapter-react-15
withenzyme-adapter-react-16
both inpackage.json
andtests/setupTests.js
.jest
to `21.3.0-betaª to get a fix for the rAF warning (see more at: Add simple rAF polyfill in jsdom environment jestjs/jest#4568 (comment) )raf
package, replacing the existing one.<noscript />
fornull
.renderTree.html()
's result and also removes the usage ofReact.PropTypes
in favour ofprop-types
one.Where should the reviewer start: