Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ampers: Alex; #32

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open

Ampers: Alex; #32

wants to merge 21 commits into from

Conversation

brownav
Copy link

@brownav brownav commented Jun 18, 2018

Inspiration Board

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
Explain the steps in creating a new Card from the form. Gather user input from form and set card state to user inputs. Use callback function to send send state (user inputs) up to the Board component as a NewCardForm prop (NewCardForm is rendered in Board component). Use the NewCardForm prop as function parameter to pass in axios POST request function, then update the state of cards to include the recently added card that was passed in as a parameter.
How did you learn how to use the API? I first examined outputs for different verb + endpoint requests to see how the API data was structured and to determine how to structure my own verb + endpoint requests as needed.
What function did you use to place the GET request from the API to get the list of cards? Why use that function? componentDidMount, because whatever is nested in that function will run upon component initialization and render immediately without having to be explicitly called. This way, as component state changes, they will automatically be rendered without having to manually refresh the page (i.e. continually display list of updated cards).
Explain the purpose of a Snapshot test. Snapshot test records the virtual DOM as a 'snapshot' then mounts and unmounts a particular component and compares the result to the original 'snapshot' to determine if there are any differences. Shallow testing only tests one component at a time and ignores child components, whereas mount testing will render and test all child components as well, which takes more time and space.
What purpose does Enzyme serve in testing a React app? Enzyme allows the programmer to use Jest to do both deep and snapshot testing (mount and shallow).

@brownav
Copy link
Author

brownav commented Jun 18, 2018

I render message notifications on App component for when a new card is added or deleted, however there is no timer to clear those states, so they remain rather than disappearing after an allotted amount of time. It was useful for getting more practice on passing up information from child to parent components, but I would have liked to adjust the messaging system so that messages disappear after 3 seconds or so rather than remaining on the screen.

@CheezItMan
Copy link

Inspiration Board

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene Check
Comprehension questions Check
General
Card Component renders the data provided as props Check
Board Component takes a URL and renders the list of Cards and passes in callback functions Check
NewCardform Component is a controlled form and uses a callback function to return entered data to the parent component Check
API
GET request made in componentDidMount Check
DELETE request made in callback function Check
POST request made in callback function passed to NewCardForm component. Check
Snapshot testing Check
Styling Good use of pre-made styles
Overall Nicely done you hit all the learning goals. I did leave a few comment in your code. Well done.

}

setNotifications = (messages) => {
if (messages.message || messages.error) {

Choose a reason for hiding this comment

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

Interesting way to pass notifications back up

axios.delete(URL + cardId)
.then((response) => {
let cards = this.state.cards
let updatedCards = cards.filter(function(i) {

Choose a reason for hiding this comment

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

👍

}

Board.propTypes = {

};
notificationCallback: PropTypes.func

Choose a reason for hiding this comment

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

Should this prop be required?

wrapper.unmount();
});

test('fields update when user enters input', () => {

Choose a reason for hiding this comment

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

👍

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