Skip to content

ATS-COM-ORD-004Use promotion codes before the sale: Acceptance Test Set

Markdown

ATS-COM-ORD-004

Use promotion codes before the sale: Acceptance Test Set

Markdown
  • DocumentProposed

Planning

Proves capability
CAP-COM-ORD-004

KindAcceptance test setProduct areaCommerceModuleCustomer purchases, purchased benefits and vendor stockRevision1

Read atservices-commerce c8b66a98react-console baf6dae3

Test Scenarios

8 scenarios proving CAP-COM-ORD-004; 8 bound to an existing test.

01 Equivalent entered codes identify one offerapitest
Proves
BR-CAP-COM-ORD-004-01
Preconditions
The fixture defines the displayed early-bird code.
Steps
Enter case and spacing variants including full-width text.
Expected
Each resolves to the same code while retaining the trimmed entered form.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/checkout/tests/e2e/promotions.e2e.spec.js#applies the one code to each, full-width letters and an ideographic space included (D-REC-12), shown by its display code, the entered code kept as typed (trimmed at the boundary)
Source
services-commerce:modules/checkout/tests/e2e/promotions.e2e.spec.js#applies the one code to each, full-width letters and an ideographic space included (D-REC-12), shown by its display code, the entered code kept as typed (trimmed at the boundary)
02 Unsupported code text is rejected at the boundaryapinegativetest
Proves
BR-CAP-COM-ORD-004-02
Preconditions
An editable cart is available.
Steps
Submit slash, percent, backslash, unusual letter, emoji, NUL and blank cases from the bindings.
Expected
The response explains validation failure and retains no invalid code.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/checkout/tests/e2e/checkout-promotion-code-refusals.e2e.spec.js#refuses a code with a slash and a percent sign, 400, with the sentence (D-REC-6)
services-commerce:modules/checkout/tests/e2e/checkout-promotion-code-refusals.e2e.spec.js#refuses a code holding a NUL character, 400, where the database would refuse the text as a 500
Source
services-commerce:modules/checkout/tests/e2e/checkout-promotion-code-refusals.e2e.spec.js#refuses a code with a slash and a percent sign, 400, with the sentence (D-REC-6)
03 Repeated promotion entry leaves the first use intactapinegativetest
Proves
BR-CAP-COM-ORD-004-03
Preconditions
An early-bird code is already entered.
Steps
Enter it again and enter another code for the same promotion.
Expected
The response identifies already_applied and history records the rejected entry.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/checkout/tests/e2e/promotions.e2e.spec.js#refuses the same code entered again, 409 already_applied with the customer’s message
services-commerce:modules/checkout/tests/e2e/promotions.e2e.spec.js#records the refusal on the trail as checkout.promotion_code_rejected, already_applied
services-commerce:modules/checkout/tests/e2e/promotions.e2e.spec.js#rejects a second code of the same promotion already_applied, the first still applied
Source
services-commerce:modules/checkout/tests/e2e/promotions.e2e.spec.js#refuses the same code entered again, 409 already_applied with the customer’s message
04 A non-qualifying code is recorded without a savingapinegativetest
Proves
BR-CAP-COM-ORD-004-04
Preconditions
A merchandise offer is entered on a membership-only purchase.
Steps
Preview and place that cart.
Expected
The order remains at full price with a rejected-code reason and no redemption.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/checkout/tests/e2e/promotions.e2e.spec.js#rejects the code nothing_qualifies, with the customer’s message, and takes nothing off
services-commerce:modules/checkout/tests/e2e/promotions.e2e.spec.js#places the order at the full price, the code not applied
services-commerce:modules/checkout/tests/e2e/promotions.e2e.spec.js#keeps the code on the order’s pricing snapshot as not applied, with its reason
services-commerce:modules/checkout/tests/e2e/promotions.e2e.spec.js#writes no redemption and leaves the uses unchanged
Source
services-commerce:modules/checkout/tests/e2e/promotions.e2e.spec.js#rejects the code nothing_qualifies, with the customer’s message, and takes nothing off
05 A zero-value second discount consumes no useapitest
Proves
BR-CAP-COM-ORD-004-05
Preconditions
An item first receives a full-value promotion and then another percentage code.
Steps
Preview and place with both entries.
Expected
The first offer supplies the saving; the second remains unapplied and has no use count.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/checkout/tests/e2e/promotions.e2e.spec.js#previews TENTH as giving nothing, FREEALL taking the whole $100.00
services-commerce:modules/checkout/tests/e2e/promotions.e2e.spec.js#keeps TENTH on the order as not applied, with its reason
Source
services-commerce:modules/checkout/tests/e2e/promotions.e2e.spec.js#previews TENTH as giving nothing, FREEALL taking the whole $100.00
06 Only placement records the redemptionapitest
Proves
BR-CAP-COM-ORD-004-06
Preconditions
A qualifying registration carries an applied early-bird code.
Steps
Preview repeatedly and then place.
Expected
Previews do not consume a use; placement records one redemption and one code and promotion use.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/checkout/tests/e2e/promotions.e2e.spec.js#records the redemption applied with one allocation of 2500
services-commerce:modules/checkout/tests/e2e/promotions.e2e.spec.js#takes one use of the code and of the promotion
Source
services-commerce:modules/checkout/tests/e2e/promotions.e2e.spec.js#records the redemption applied with one allocation of 2500
07 Restricted offers fail closed when eligibility is unresolvedapitest
Proves
BR-CAP-COM-ORD-004-07
Preconditions
Fixtures cover matching-only, non-matching-only and indeterminate rules.
Steps
Preview and place as qualifying and non-qualifying purchasers.
Expected
The appropriate restricted offers apply, while refusal or indeterminate results prevent their redemption and placement rechecks them.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/checkout/tests/e2e/promotion-eligibility.e2e.spec.js#applies to the member: the preview carries it and no rejection
services-commerce:modules/checkout/tests/e2e/promotion-eligibility.e2e.spec.js#rejects it in the preview as purchaser_not_eligible, with the customer’s sentence
services-commerce:modules/checkout/tests/e2e/promotion-eligibility.e2e.spec.js#admits the buyer who does not match the rule: applied in the preview, placed with the discount
services-commerce:modules/checkout/tests/e2e/promotion-eligibility.e2e.spec.js#rolls everything back: no order, no use, the checkout open
services-commerce:modules/checkout/tests/e2e/promotion-eligibility.e2e.spec.js#refuses it even for must_not_match: an indeterminate decision is not "does not match"
Source
services-commerce:modules/checkout/tests/e2e/promotion-eligibility.e2e.spec.js#applies to the member: the preview carries it and no rejection
08 Portal snapshots omit staff-only explanationsapitest
Proves
BR-CAP-COM-ORD-004-08
Preconditions
The offer belongs to a different business unit.
Steps
Enter it in staff and portal contexts and inspect the returned snapshot.
Expected
Staff receive the operational explanation; the portal result retains only customer wording.
Data
Use the controlled records and transports established by the cited tests.
Bound to
services-commerce:modules/checkout/tests/e2e/promotions.e2e.spec.js#tells the console clerk the staff message, which says business unit
services-commerce:modules/checkout/tests/e2e/promotions.e2e.spec.js#tells the portal member the customer message alone, which does not say business unit
services-commerce:modules/checkout/tests/e2e/promotions.e2e.spec.js#keeps the staff message out of the price snapshot the portal member reads
Source
services-commerce:modules/checkout/tests/e2e/promotions.e2e.spec.js#tells the console clerk the staff message, which says business unit

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.