Git Product home page Git Product logo

crwn-clothing's People

Contributors

chrischandler avatar

Watchers

 avatar

crwn-clothing's Issues

Add testing to the app

You can always refer to the github repo in the resources that has tests written for the app (which we have written for you) to see how you might tackle writing tests for certain components, or testing certain features! We have also linked the enzyme documentation in the resources as well for you to refer to, this way you can see what methods you may want to use to test specific features!

One caveat to note, if you want to use the selector based methods in enzyme to target styled-components in a component, just add the .displayName prop to the styled component where it's equal to the name of the const. Then you can target that displayName as a string that you pass as the selector value. For example:

// header.styles.jsx

export const OptionLink = styled(Link)`
  padding: 10px 15px;
  cursor: pointer;
`;

OptionLink.displayName = 'OptionLink';


// Header.test.js

describe('test for OptionLink', () => {
    wrapper.find('OptionLink') // <= finds OptionLink styled components in wrapper
});

Good luck!

Github: start of lesson
Github: solution with tests

Enzyme documentation

Move cart to Firebase

The coding challenge is to move your cart for any signed in user into firebase! Key things to consider here include:

What happens if a user isn't signed in and adding items to the cart? Do we still fire off a request to update a cart in firebase?
What happens when users sign out/ sign in? Should we pull that users cart from firebase into our application?
When should we create the users cart document in firebase?
What security rules do I need to set up for carts in firebase?
This challenge will bring together everything we've learned in this course, but I would like to point you towards certain resources that will help you in building this feature!

We will probably have to query against a carts collection (i.e. we need to enable list in security rules) in firebase for a specific cart that is related to our user. We will need the where() query as well as an understanding of using the resource and data keyword in our firebase security rules.

If you get stuck or have completed your solution, you can compare it to mine in the following repo:

https://github.com/ZhangMYihua/crwn-clothing-firebase-cart

Happy coding!

Githhub: Final Solution

Firestore where keyword

Security rules resources and data validation

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.