Skip to content

Conversation

@brandyaustinseattle
Copy link

@brandyaustinseattle brandyaustinseattle commented Jun 15, 2018

Comprehension Questions

Question Answer
Explain the steps in creating a new Card from the form. The user enters their text and selects an emoji. The onInputChange function is called to so the state gets updated with each letter that's entered in. The user hits the submit button and the onFormSubmit function is called which passes the info to the addCardCallback. The onFormSubmit function resets the state so the text and emoji fields clear out. The addCard function is run which sends the info to the API and updates the state.
How did you learn how to use the API? I entered sample URL's into the address bar to see what info it returned. The documentation was pretty straight forward so it wasn't necessary to dig very deep.
What function did you use to place the GET request from the API to get the list of cards? Why use that function? The componentDidMount function in Board takes care of placing the get request. This function is use because then the get request is processed every time the board re-loads so that the user doesn't see incorrect information.
Explain the purpose of a Snapshot test. A Snapshot test makes it possible to track how the dom structure and output changes in response to edits in the code.
What purpose does Enzyme serve in testing a React app? Enzyme makes it possible to create mount and shallow views. Shallow views are useful because it reduces the size the file to that of the component being tested.

@Hamled
Copy link

Hamled commented Jun 22, 2018

Inspiration Board

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene Somewhat. There could be more commits, just from breaking these larger commits into smaller changes.
Comprehension questions
General
Card Component renders the data provided as props
Board Component takes a URL and renders the list of Cards and passes in callback functions
NewCardform Component is a controlled form and uses a callback function to return entered data to the parent component
API
GET request made in componentDidMount
DELETE request made in callback function
POST request made in callback function passed to NewCardForm component.
Snapshot testing
Styling
Overall


card["id"] = cardInfo[i].card.id
card["text"] = cardInfo[i].card.text
card["emoji"] = cardInfo[i].card.emoji
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code could probably be simplified to cards.push(cardInfo[i].card);.

deleteCard = (cardID) => {

let deleteURL = `${url}${this.props.boardName}/cards/${cardID}`;
axios.delete(deleteURL);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd probably be best to have then and catch handlers for this delete request. For example, if the delete fails for some reason, we would want to display that information to the user.


addCard = (card) => {
let boardURL = `${url}${this.props.boardName}/cards`
axios.post(boardURL, card);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as with the delete request, we should have then and catch handlers for this.

In particular, its important to have the following code (where we insert the new card into the state) only happen in the then handler, because we don't want to add the card "locally" if the API actually rejected our request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants