-
Notifications
You must be signed in to change notification settings - Fork 43
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
Sam Berk -- Octos #26
base: master
Are you sure you want to change the base?
Conversation
…to display all cards
Inspiration BoardWhat We're Looking For
|
<Card id={0} text="" emoji="" deleteCardCallback={callback}/> | ||
); | ||
|
||
card.find('button').simulate('click'); |
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.
This test is failing because you have a confirmation dialog as well. You need to research how to mock that.
this.setState({ | ||
cards: updatedCards | ||
}); | ||
window.location.reload(); |
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're causing the entire page to reload which defeats the entire purpose of doing an SPA.
render() { | ||
const cards = this.state.cards.map((card, index) => { | ||
return ( | ||
<div> |
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.
Since this function is returning a collection of Cards, you need to include a key attribute.
Something like:
<div key={index}>
|
||
id: PropTypes.number.isRequired, | ||
text: PropTypes.string.isRequired, | ||
emoji: PropTypes.string.isRequired, |
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's either the emoji is required or the text, but not necessarily both!
Inspiration Board
Congratulations! You're submitting your assignment!
Comprehension Questions