Time - Kate P & Hannah J#2
Open
Hannah0124 wants to merge 22 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 clickingukeyboard every time we run a test.(2)Although
inline CSS using styleis not recommended at Ada, we use it forrandomColorto have a variety of random colors for each card. Please let us know if there is a way to do it byexternal stylesheets using className.Comprehension Questions
(2)
POSTrequest is made.(3) When response is received, we update the state of existing
cardsby adding a new card.(4)Once the state is changed, the page gets re-rendered.
useEffecthook that takes a function as a parameter (in this case it wasaxios.get(…).then(…).catch(…)).useEffecthook runs that function once the component gets to themounted stage. The purpose of usinguseEffectfunction is to prevent delay in rendering because of the API call. AlsouseEffectenables us to run this function every time the component updates. (This is what the second parameter[board_name]is for).Unit teststest functionality of the program, whereassnapshot teststest 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.Enzymeprovides some methods for rendering components, finding elements and interacting with them. We can also describeEnzymeas adding additional functionality.Enzymecannot run withoutJestor other testing libraries.