-
Notifications
You must be signed in to change notification settings - Fork 17
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
feat: fill shippingInfo on setShippingMethod #223
feat: fill shippingInfo on setShippingMethod #223
Conversation
|
The `?? false` part of the expression was never evaluated, but the result was still correct because `!undefined === true`. This commit mainly fixes the TS2869 typescript errors.
We need it in the cart setShippingMethod action
- Ensure shipping method matches cart - Ensure shipping rate matches cart - Use correct shipping rate tier for determining price when applicable - Improve error handling & reporting
This got accidentally overwritten during a git merge conflict. Restoring them to reduce noise in the diff
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.
My bad, I still had the comment on line 12 of src/shipping.ts
in draft. Thought I'd submitted it already
We were having some trouble writing tests around a shipping method because
cart.shippingInfo.taxedPrice
wasn't populated by the mocking library. This PR aims to fix that.Status
Currently looking for feedback, particularly on the unresolved questions below. A couple t's left to cross and i's left to dot, but so far the newly written tests pass and it works as expected when testing locally (symlinked) in our project.
Will also add a changeset.
Questions
There's a couple remaining questions around edge cases:
zone.location
field's docs answers this, can anyone confirm?getShippingMethodsMatchingCart
processes it, so[0]
is correctcart.shippingInfo.price
should be the net or gross price.