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

Cart Persistence on Refresh #2

Open
1 task
sbmsr opened this issue May 1, 2022 · 0 comments
Open
1 task

Cart Persistence on Refresh #2

sbmsr opened this issue May 1, 2022 · 0 comments
Labels
Difficulty: Medium A Task that can take a day to complete. enhancement New feature or request

Comments

@sbmsr
Copy link
Member

sbmsr commented May 1, 2022

Description

We would like to persist a customer's cart on refresh. This means we need to store their cart in a persistent browser storage. Check out the localStorage API to build this enhancement.

How to Reproduce

  1. Run app locally
  2. add item to cart
  3. Refresh page
  4. see that cart is empty
CartPersistenceOnRefresh.mp4

Deliverables

  • Cart is persisted when user does refresh
@sbmsr sbmsr added enhancement New feature or request Difficulty: Medium A Task that can take a day to complete. labels May 1, 2022
JunYuHuang added a commit to JunYuHuang/react-ecommerce that referenced this issue Apr 10, 2023
JunYuHuang added a commit to JunYuHuang/react-ecommerce that referenced this issue Apr 11, 2023
JunYuHuang added a commit to JunYuHuang/react-ecommerce that referenced this issue Apr 11, 2023
What:
- Adds the `listitem` role to rendered cart items in `Cart.jsx`.

Why:
- Assuming Issue developer-job-simulation#2 has been properly fixed in the project, the added role will help the modified project pass the test that checks if Issue developer-job-simulation#2 has been fixed.
- If this role is not added to the shopping cart list item, the test in the test repository for this project that checks if Issue developer-job-simulation#2 has been fixed will fail.
- That test specifically counts the number of (shopping cart) elements with a `role` attribute of `listitem`. 
- Since the items in the shopping cart do not have that role, the test will fail even if the issue (Issue developer-job-simulation#2) has been fixed.

References:
- [The test repository for this project](https://github.com/developer-job-simulation/react-ecommerce-tests/blob/main/test.js)
maxim55069633 added a commit to maxim55069633/react-ecommerce that referenced this issue May 4, 2023
antono91 added a commit to antono91/cbm-react-ecommerce that referenced this issue Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Difficulty: Medium A Task that can take a day to complete. enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant