-
Notifications
You must be signed in to change notification settings - Fork 719
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
test: increase code coverage #784
Conversation
const HOC = withBoundingRects(Component); | ||
const wrapper = mount(<HOC />); | ||
const RenderedComponent = wrapper.find(Component); | ||
expect(RenderedComponent.prop('rect')).toEqual(emptyRect); |
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.
🤔 wasn't sure how to mock the RenderComponent.node.parentNode to not have getBoundingRect
which triggers the parentRect = emptyRect
branch... so skipped it for now. Safe to assume it works.
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.
nice! 🙌 had one thought on the config, otherwise lgtm.
@@ -1,54 +0,0 @@ | |||
import { withBoundingRects } from '../src'; | |||
|
|||
// const expectedRectShape = expect.objectContaining({ |
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.
didn't know this was all commented out 😮
@@ -65,4 +65,15 @@ describe('<LinePathAnnotation />', () => { | |||
), | |||
).toBe(true); | |||
}); | |||
|
|||
test('it should have default x and y accessors', () => { |
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.
We could use it(...)
function instead of test(...)
too so it will read more like
it('should have default x and y accessors', ...)
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.
sure, i don't have a preference
This takes vx from 26% to 44% code coverage. More to come in future PRs...
🏠 Internal