Skip to content

ATS-COM-ORD-001Build a buyer’s cart: Acceptance Test Set

Markdown

ATS-COM-ORD-001

Build a buyer’s cart: Acceptance Test Set

Markdown
  • DocumentProposed

Planning

Proves capability
CAP-COM-ORD-001

KindAcceptance test setProduct areaCommerceModuleCustomer purchases, purchased benefits and vendor stockRevision1

Read atservices-commerce c8b66a98react-console baf6dae3

Test Scenarios

10 scenarios proving CAP-COM-ORD-001; 10 bound to an existing test.

01 Portal purchase cannot name another contactapinegativetest
Proves
BR-CAP-COM-ORD-001-01
Preconditions
The signed-in member and a different contact share a workspace.
Steps
Attempt creation with the different contact as buyer.
Expected
The response is 403 and creation does not proceed.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/checkout/tests/e2e/checkouts.e2e.spec.js#refuses a member opening a checkout for another contact, 403
Source
services-commerce:modules/checkout/tests/e2e/checkouts.e2e.spec.js#refuses a member opening a checkout for another contact, 403
02 Invalid items leave the cart unchangedapinegativetest
Proves
BR-CAP-COM-ORD-001-02
Preconditions
The fixtures include retired and unsellable products, a two-unit limit, a required payload and USD-only support.
Steps
Submit the invalid product, excessive quantity, malformed details and unsupported currency cases.
Expected
Each request returns 400 with the relevant item or currency problem and no accepted item write.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/checkout/tests/e2e/checkouts.e2e.spec.js#refuses a product the tenant does not have: product_not_sellable
services-commerce:modules/checkout/tests/e2e/checkouts.e2e.spec.js#refuses a retired product and an unsellable product type: product_not_sellable
services-commerce:modules/checkout/tests/e2e/checkouts.e2e.spec.js#refuses a quantity past the product’s purchase limit: quantity_out_of_limits
services-commerce:modules/checkout/tests/e2e/checkouts.e2e.spec.js#refuses a payload that does not parse as the participant’s schema: payload_does_not_parse
services-commerce:modules/checkout/tests/e2e/checkouts.e2e.spec.js#refuses a currency the business unit does not support: currency_not_supported
Source
services-commerce:modules/checkout/tests/e2e/checkouts.e2e.spec.js#refuses a product the tenant does not have: product_not_sellable
03 Party references require record identitiesapinegativetest
Proves
BR-CAP-COM-ORD-001-03
Preconditions
Contact records have both internal identities and alternative text labels.
Steps
Use alternative labels for the buyer, acting contact, bill-to and recipient.
Expected
Validation returns 400 identifying the offending field before saving.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/checkout/tests/e2e/checkout-record-ids.e2e.spec.js#refuses a buyer that is a slug when the checkout is opened, 400 naming buyer_id, and writes nothing
services-commerce:modules/checkout/tests/e2e/checkout-record-ids.e2e.spec.js#refuses an acting contact, a bill-to and a recipient that are slugs, each naming its field
Source
services-commerce:modules/checkout/tests/e2e/checkout-record-ids.e2e.spec.js#refuses a buyer that is a slug when the checkout is opened, 400 naming buyer_id, and writes nothing
04 Organization authority can be overridden by permitted staffapitest
Proves
BR-CAP-COM-ORD-001-04
Preconditions
A contact lacks the organization’s required role; two staff contexts differ in placement authority.
Steps
Attempt the organization purchase as the member and each staff context.
Expected
The authorized staff case records an override; the other cases return buyer_may_not_act.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/checkout/tests/e2e/checkouts.e2e.spec.js#accepts a member who holds the store’s purchasing role at the organization
services-commerce:modules/checkout/tests/e2e/checkouts.e2e.spec.js#refuses a member affiliated without the role: buyer_may_not_act, NOT_AUTHORIZED_FOR_ORGANIZATION
services-commerce:modules/checkout/tests/e2e/checkouts.e2e.spec.js#lets a console user with commerce.orders.create buy for the organization naming any acting contact, and audits the override
services-commerce:modules/checkout/tests/e2e/checkouts.e2e.spec.js#refuses a console clerk without commerce.orders.create the same purchase, 400 buyer_may_not_act
Source
services-commerce:modules/checkout/tests/e2e/checkouts.e2e.spec.js#accepts a member who holds the store’s purchasing role at the organization
05 Public assortment checks permit staff exceptionsapitest
Proves
BR-CAP-COM-ORD-001-05
Preconditions
One fixture product is unpublished and another falls outside the selected assortment.
Steps
Try both products as a portal buyer and as authorized console staff.
Expected
Portal requests return publication or assortment problems; staff can retain both items.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/checkout/tests/e2e/checkout-public-sale.e2e.spec.js#refuses a portal member opening a checkout with a draft product: 400 product_not_published, naming the store, nothing written
services-commerce:modules/checkout/tests/e2e/checkout-public-sale.e2e.spec.js#refuses a portal member a published product the store does not admit: 400 product_not_in_store_assortment
services-commerce:modules/checkout/tests/e2e/checkout-public-sale.e2e.spec.js#lets a console user holding commerce.orders.create open a checkout with the draft product and add the one outside the assortment
Source
services-commerce:modules/checkout/tests/e2e/checkout-public-sale.e2e.spec.js#refuses a portal member opening a checkout with a draft product: 400 product_not_published, naming the store, nothing written
06 Cart changes retain version and actor evidenceapitest
Proves
BR-CAP-COM-ORD-001-06
Preconditions
An open cart and a stand-in support identity are available.
Steps
Add, replace and remove items, then inspect version and event data.
Expected
Versions advance and the event helper records the supplied support actor.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/checkout/tests/e2e/checkouts.e2e.spec.js#adds after the last, changes the intent and clears what was advised, removes, each bumping the version
Source
services-commerce:modules/checkout/tests/e2e/checkouts.e2e.spec.js#adds after the last, changes the intent and clears what was advised, removes, each bumping the version
07 Expiry processing respects limits and workspace ownershipapitest
Proves
BR-CAP-COM-ORD-001-07
Preconditions
Expired carts span two workspaces alongside live and placed records.
Steps
Run expiry selection and abandonment with a bounded limit, then run again.
Expected
Expired records are processed in expiry order within their workspace; other states remain untouched.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/checkout/tests/integration/services/checkout/checkout-sweeper.integration.spec.js#abandoned each expired open checkout in its own tenant, with the system as the actor and expired as the reason
services-commerce:modules/checkout/tests/integration/services/checkout/checkout-sweeper.integration.spec.js#takes at most the limit, oldest expiry first, and leaves the rest to the next run; a cancelled checkout is not found
services-commerce:modules/checkout/tests/e2e/checkouts.e2e.spec.js#expires seven days out, and the first item carries the participant’s current schema version, unvalidated
Source
services-commerce:modules/checkout/tests/integration/services/checkout/checkout-sweeper.integration.spec.js#abandoned each expired open checkout in its own tenant, with the system as the actor and expired as the reason
08 Abandonment releases the held itemapinegativetest
Proves
BR-CAP-COM-ORD-001-08
Preconditions
A cart has an application-held scarce resource.
Steps
Abandon it and attempt a later item addition.
Expected
The hold is released with history and the later addition returns checkout_not_open.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/checkout/tests/e2e/checkouts.e2e.spec.js#moves an open checkout to abandoned, after which it no longer changes (409 checkout_not_open)
services-commerce:modules/checkout/tests/e2e/holds-and-claims.e2e.spec.js#releases every hold when the checkout is abandoned
Source
services-commerce:modules/checkout/tests/e2e/checkouts.e2e.spec.js#moves an open checkout to abandoned, after which it no longer changes (409 checkout_not_open)
09 Scarce holds reject competing or excessive requestsapinegativetest
Proves
BR-CAP-COM-ORD-001-09
Preconditions
The last booth is reserved for one buyer.
Steps
Request it as a second buyer, extend beyond the allowed ceiling and remove the held item.
Expected
The competing and excessive requests return hold_unavailable and hold_not_extendable; removal releases the resource.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/checkout/tests/e2e/holds-and-claims.e2e.spec.js#acquires the hold: 200 with the reservation held, the item prepared with it, the participant’s row held, hold_acquired on the trail
services-commerce:modules/checkout/tests/e2e/holds-and-claims.e2e.spec.js#refuses another buyer the booth: 409 hold_unavailable with the participant’s reason, and their preview marks the item unavailable
services-commerce:modules/checkout/tests/e2e/holds-and-claims.e2e.spec.js#refuses an extension past the policy’s ceiling, 409 hold_not_extendable with the participant’s problem
services-commerce:modules/checkout/tests/e2e/holds-and-claims.e2e.spec.js#releases an item’s hold through the participant when the item is removed, with holds_released on the trail
Source
services-commerce:modules/checkout/tests/e2e/holds-and-claims.e2e.spec.js#acquires the hold: 200 with the reservation held, the item prepared with it, the participant’s row held, hold_acquired on the trail
10 Cart transitions reject skipped and terminal movesapinegativetest
Proves
BR-CAP-COM-ORD-001-14
Preconditions
An open cart exists and a separate cart has completed placement.
Steps
Attempt direct placement without preparation, place without an order link and transition the placed cart; also exercise permitted preparation and cancellation transitions.
Expected
Invalid moves are refused and allowed moves preserve their required order linkage.
Data
Use the isolated checkout records prepared by the persistence suite.
Bound to
services-commerce:modules/checkout/tests/integration/services/persistence/checkouts.integration.spec.js#refuses open to placed (preparing comes first), and lets open go abandoned or cancelled
Source
services-commerce:modules/checkout/tests/integration/services/persistence/checkouts.integration.spec.js#refuses open to placed (preparing comes first), and lets open go abandoned or cancelled

The Markdown files under specs/ in rhythmsoftware/rhythm-v2-docs are the canonical source of truth. This reader is a generated, read-only projection of them.