commercetools-node-mock icon indicating copy to clipboard operation
commercetools-node-mock copied to clipboard

feat: WIP fill shippingInfo on setShippingMethod

Open mickdekkers opened this issue 1 year ago • 1 comments

Note: this is still a bit rough, hence the draft PR. Open to feedback, though

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. TBC next week

Questions

There's a couple remaining questions around edge cases:

  • https://github.com/mickdekkers/commercetools-node-mock/blob/9bb75efa355dd6e5c3fa409b98125b362e08bf8b/src/repositories/cart/actions.ts#L654
    • I think the note in the zone.location field's docs answers this, can anyone confirm?
  • https://github.com/mickdekkers/commercetools-node-mock/blob/9bb75efa355dd6e5c3fa409b98125b362e08bf8b/src/repositories/cart/actions.ts#L665-L666
    • The ZoneRate docs mention the shipping rates are defined by currency, but can anyone confirm is this the only differentiating factor? If so, there should be exactly one entry in the array after getShippingMethodsMatchingCart processes it, so [0] is correct

mickdekkers avatar Oct 03 '24 13:10 mickdekkers

⚠️ No Changeset found

Latest commit: 125fa042f85545545eed077a471d897aa2b12d55

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Oct 03 '24 13:10 changeset-bot[bot]