Skip to content

Time - Kate P & Hannah J#2

Open
Hannah0124 wants to merge 22 commits into
Ada-C13:masterfrom
Hannah0124:master
Open

Time - Kate P & Hannah J#2
Hannah0124 wants to merge 22 commits into
Ada-C13:masterfrom
Hannah0124:master

Conversation

@Hannah0124

@Hannah0124 Hannah0124 commented Apr 24, 2020

Copy link
Copy Markdown

Inspiration Board

Congratulations! You're submitting your assignment!
homepage: https://hannah0124.github.io/inspiration-board/

Note:
(1)Due to using randomColor, we need to update a snapshot test by clicking u keyboard every time we run a test.
(2)Although inline CSS using style is not recommended at Ada, we use it for randomColor to have a variety of random colors for each card. Please let us know if there is a way to do it by external stylesheets using className.

Comprehension Questions

Question Answer
What is the flow of data from input on the form to being a new card on the board? (1) Data is inputted and gets submitted through UI.
(2)POST request is made.
(3) When response is received, we update the state of existing cards by adding a new card.
(4)Once the state is changed, the page gets re-rendered.
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 a useEffect hook that takes a function as a parameter (in this case it was axios.get(…).then(…).catch(…)). useEffect hook runs that function once the component gets to the mounted stage. The purpose of using useEffect function is to prevent delay in rendering because of the API call. Also useEffect enables us to run this function every time the component updates. (This is what the second parameter [board_name] is for).
How do snapshot tests differ from unit tests? Unit tests test functionality of the program, whereas snapshot tests test the shape of the DOM; they don't test behavior. Also, when you first write the snapshot test, it will pass, which is not the case with unit tests.
What purpose does Enzyme serve in testing a React app? Enzyme provides some methods for rendering components, finding elements and interacting with them. We can also describe Enzyme as adding additional functionality.Enzyme cannot run without Jest or other testing libraries.

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