chrischandler / crwn-clothing Goto Github PK
View Code? Open in Web Editor NEWEcommerce class project using React, SCSS, and Stripe API
Ecommerce class project using React, SCSS, and Stripe API
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
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.