Repository navigation
WIP: mock Checkout, the Integration Layer and the resources the Terraform provider tests - #451
Draft
pimvernooij wants to merge 3 commits into
Draft
pimvernooij wants to merge 3 commits into
pimvernooij wants to merge 3 commits into
Conversation
… provider tests
Mock the commercetools Checkout API's applications and payment
integrations, typed with @commercetools/checkout-sdk, and the Commerce
Integration Layer's management API under /{projectKey}/main. With MSW
they are served on the new checkoutHost and integrationLayerHost options,
and MSW now forwards PUT and PATCH as well.
Add MCP Servers, the discount group of a Cart Discount, the Discount
Group's setIsActive, and the discounts and inventory Project update
actions.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 4e961a2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Inactive Checkout always answers a payment integration with an automated reversal configuration, Inactive when the draft gives none. The mock now does too, so a client that relies on it sees the same answer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Work in progress, opened to share where this stands. Part of a proof of concept for running Evolve on the commercetools Commerce Integration Layer (CIL). With it, the terraform-provider-commercetools acceptance tests for these resources run against the mock instead of against fakes in the provider.
What changes
Checkout API: applications and payment integrations under
/{projectKey}/applicationsand/{projectKey}/payment-integrations, with every update action in the spec.@commercetools/checkout-sdk(dev dependency and optional peer dependency).Application.descriptionis typedstring, as in the spec, but the API uses aLocalizedString;src/checkout-types.tscorrects that one field.Commerce Integration Layer management API under
/{projectKey}/main:commercetools publishes no spec for this API yet, so it follows the one the Go SDK's
integrationlayerpackage is generated from. Every Project is taken as enrolled, and the state is held in memory whatever the storage.MSW:
checkoutHostandintegrationLayerHostoptions (https://checkout.*.commercetools.com,https://extensions.integration-layer.*.commercetools.com);Platform:
discountGroupof a Cart Discount, and the Discount Group'ssetIsActive;setDiscountsConfiguration,setReservationExpirationInMinutesandsetReleaseExpiredReservationsProject update actions.Three changesets, all minor.
Checks
pnpm tscclean,pnpm test968 passing,pnpm biome checkwith the one warningmainalready has.Next
The provider's CI runs
labdigital/commercetools-mock-server:3.0.0-beta.3. Its acceptance tests for these resources need an image from this branch, so a release of this comes before the provider's.🤖 Generated with Claude Code