test(nodejs): add checkout behavioral test suite#138
Merged
carolinerg1 merged 1 commit intoJul 24, 2026
Merged
Conversation
damaz91
approved these changes
Jul 23, 2026
Adds behavioral coverage on the Node.js sample's CI lane, mirroring the Python server's suite, so a checkout-flow regression no longer ships green. Uses the existing node:test + app.request() conventions and the @ucp-js/sdk schemas (rest/nodejs consumes the SDK since Universal-Commerce-Protocol#139), no new dependencies. - lifecycle: create -> retrieve -> complete (order assigned), payment failure, cancel, and completed/canceled immutability - idempotency: same-key replay, same-key/different-body conflict, keyless - validation: unknown product and over-stock rejection - fulfillment: options are quoted, selecting one adds its cost to the receipt, and completing without a fulfillment selection is rejected - discount: case-insensitive match, empty codes clear, allocations reconcile
vishkaty
force-pushed
the
test/nodejs-behavioral-suite
branch
from
July 24, 2026 03:38
b2c38c4 to
fb97443
Compare
Contributor
Author
|
Heads-up @damaz91 — I rebased this onto latest While rebasing I also added the fulfillment area — options are quoted, selecting one adds its cost to the receipt, and completing without a fulfillment selection is rejected — which completes the coverage I offered in #136. Clean single commit on latest |
carolinerg1
approved these changes
Jul 24, 2026
carolinerg1
merged commit Jul 24, 2026
cc2b57f
into
Universal-Commerce-Protocol:main
13 checks passed
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.
Closes the Node.js behavioral test gap described in #136.
What
Adds a behavioral test suite for the Node.js sample, mirroring the Python
server's coverage on the CI lane added in #126, so a regression in the checkout
flow no longer ships green. It uses the existing
node:test+app.request()conventions and adds no dependencies.
lifecycle.test.tsidempotency.test.tsvalidation_flow.test.tsdiscount.test.ts(extended)codes[]clears discounts, andallocations[]reconcile to the applied amountWhy
The Node.js suite was three files; the Python server has a full behavioral
suite. That asymmetry meant checkout-flow regressions on the Node.js sample
passed CI. These tests exercise the real service handlers end to end through a
minimal Hono app (the same approach as
discovery.test.ts), so they catchbehavioral drift, not just types.
Verification
npm run buildclean andnpm testgreen (21 tests).pre-commit runclean (prettier, codespell).Happy to split this into per-area PRs if that reviews more easily — offered in
#136; opening it as one small suite here since the areas share the harness.