-
Notifications
You must be signed in to change notification settings - Fork 42
Caroline Nardi - Inspiration Board - Octos #35
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
base: master
Are you sure you want to change the base?
Conversation
Inspiration BoardWhat We're Looking For
|
| } | ||
|
|
||
| onClickButton = () => { | ||
| this.props.deleteCardCallback(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.
I'm not sure if there's a specific rule about this in React, but I think it's generally not considered best practice to pass a component instance itself to a callback.
In the deleteCard function from the Board component we're only using the id and index props, so we could just pass those directly instead.
| import { shallow } from 'enzyme'; | ||
|
|
||
| describe('Card', () => { | ||
| test('shallow mount', () => { |
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.
It could also be helpful to have additional tests for Card which check the snapshot if the component is rendered with a specific set of props.
Right now we're providing the id, index, and deleteCardCallback props, but none of these impact on the rendering. I think we could have further tests which provide the text and emoji props (one for each, and a third for when both are provided), as those props do impact the visual result.
Inspiration Board
Congratulations! You're submitting your assignment!
Comprehension Questions