Skip to content

Space - Becca and Jessica#20

Open
RebeccaRoach wants to merge 24 commits into
Ada-C13:masterfrom
RebeccaRoach:master
Open

Space - Becca and Jessica#20
RebeccaRoach wants to merge 24 commits into
Ada-C13:masterfrom
RebeccaRoach:master

Conversation

@RebeccaRoach

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? Our NewCardForm component had its own state that tracked input events with an onInputChange event handler. When a user clicks the submit button on the form, an onSubmit event handler is triggered. This callback function sends the new form information to the App parent component, which makes the API call that, when successful, allows for a new card object to be appended to the array. UseEffect listens for this array update and re-renders the card on the board.
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 useEffect with an axios GET request as an API call to get the list of cards. UseEffect knows to render once for every update to the list of cards. As a React hook, useEffect allows us an easy way to concisely update changed elements.
How do snapshot tests differ from unit tests? Snapshot tests ensure that nothing is missing or unnecessarily re-rendered. While unit tests are useful in TDD and help ensure methods are functioning as expected with certain inputs, snapshot tests are a way to test certain UI components are present and displayed to the user.
What purpose does Enzyme serve in testing a React app? Though we're uncertain as to what exactly enzyme is doing, Enzyme was a module we needed to install in our package.json file in order for our test suites to execute. As Enzyme is compatible with testing-library/react, it helped our snapshot test know how to mock components.

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