Skip to content

Space - Nikki & Cathy#14

Open
cojenco wants to merge 18 commits into
Ada-C13:masterfrom
cojenco:master
Open

Space - Nikki & Cathy#14
cojenco wants to merge 18 commits into
Ada-C13:masterfrom
cojenco:master

Conversation

@cojenco

@cojenco cojenco commented Apr 26, 2020

Copy link
Copy Markdown

Inspiration Board

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
What is the flow of data from input on the form to being a new card on the board? Form input triggers onChange to call onInputChange that setState the form fields. Once the form is submitted, the event listener onSubmit triggers the event handler onFormSubmit that calls a callback func to Board with the form data. Within the addCardCallback func in Board, the form data is used to complete the API POST request. Finally, the cardsList state is set to a new state to include the new card.
What function did you use to make the GET request from the API to get the list of cards? Why use that function? We used the useEffect hook to implement the API GET requests. The useEffect function allows us to specify when to make the API GET call: when the Board Component is first mounted and every time the currentBoard state changes.
How do snapshot tests differ from unit tests? Snapshot tests provide a snapshot copy of how the rendered DOM is shaped. Unit tests, on the other hand, are more used to test for a specific return of a function. Additionally, snapshot tests are not suitable for TDD.
What purpose does Enzyme serve in testing a React app? Enzyme is a JS testing utility created by Airbnb that adds additional testing functionality. Enzyme has several ways to simulate events or user interactions, and has the flexibility to support different render types.

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