-
Notifications
You must be signed in to change notification settings - Fork 81
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
CIF-1436 - Can't remove or edit items from shopping cart #314
Conversation
The problem was caused by the minicart refactoring that we've done some time ago - when the first product is added to the cart the "handlers" were not initialized. I removed the "cart handler" methods and use the actions directly. The same problem affects the coupons feature - both "Add coupon" and "Remove coupon" were broken because of the same issue. The same fix has been applied to those as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks nice and very clean 👍
</I18nextProvider> | ||
); | ||
expect(asFragment()).toMatchSnapshot(); | ||
}); | ||
|
||
it('applies an coupon', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we don't have E2E tests, I would like to keep the tests that make sure that clicks on "Apply coupon" calls the useCouponForm
resp. "Remove coupon" calls the useCouponItem
hooks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking of implementing some tests for the useXXX
"hooks" I added, but you're right, we still need to test the wiring here.
Codecov Report
@@ Coverage Diff @@
## master #314 +/- ##
============================================
+ Coverage 64.62% 64.88% +0.26%
Complexity 809 809
============================================
Files 181 184 +3
Lines 5631 5639 +8
Branches 875 875
============================================
+ Hits 3639 3659 +20
+ Misses 1864 1852 -12
Partials 128 128
Continue to review full report at Codecov.
|
Description
The problem was caused by the minicart refactoring that we've done some time ago - when the first product is added to the cart the "handlers" were not initialized. I removed the "cart handler" methods and use the actions directly.
The same problem affects the coupons feature - both "Add coupon" and "Remove coupon" were broken because of the same issue. The same fix has been applied to those as well.
Related Issue
CIF-1436
Motivation and Context
Fix the shopping cart functionality
How Has This Been Tested?
Functional testing
Screenshots (if appropriate):
Types of changes
Checklist: