-
Notifications
You must be signed in to change notification settings - Fork 492
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
world spec #253
world spec #253
Conversation
Yeah |
it('should render an svg', () => { | ||
const c = [[12, 14]] | ||
|
||
const el = render(<WorldMap coordinates={c}/>) |
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.
I decided to do a static render here since this component only has one child.
const c = [[12, 14]] | ||
|
||
const el = render(<WorldMap coordinates={c}/>) | ||
expect(el.find('svg').length).to.equal(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.
I tried to think of more meaningful assertions to add here but drew a blank. The resulting output of _renderMap
is basically all generated by d3
and I couldn't find anything else on the rendered output that could be used to assert correctness.
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 assert that the point is drawn that you passed in
💯 |
expect(el.find('svg').length).to.equal(1) | ||
}) | ||
|
||
it('should have the correct coordiates', () => { |
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.
typo coordinates
Thanks, one small note other than it looks good. Could you squash your commits together please? |
#137
I'm not sure if
_renderMap
is testable here without either exposing it or doing a non-shallow render(not advisable for unit tests).We could also make this a separate react component with width/height as state, if it's reusable.