Skip to content

ATS-COM-CAT-016Choose the best permitted promotional result: Capability Test Specification

Markdown

ATS-COM-CAT-016

Choose the best permitted promotional result: Capability Test Specification

Markdown
  • DocumentProposed
  • Product intentProposed

KindAcceptance test setProduct areaCommerceModuleCatalog and Selling ConfigurationRevision2

Read atservices-commerce c8b66a98react-console baf6dae3

Coverage

  • Rule covered
  • Transition gap: FND-COM-CAT-070
  • Validation covered
  • Permission gap: FND-COM-CAT-070
  • Edge covered
  • Failure covered
  • Boundary covered
  • Concurrency covered
  • Invariant covered
  • Interaction covered

Test Scenarios

14 scenarios proving CAP-COM-CAT-016; 12 bound to an existing test.

01 Alternative pricing matches the decision’s examplesruleunittest
Proves
BR-CAP-COM-CAT-016-01 BR-CAP-COM-CAT-016-02 AS-JNY-COM-CAT-005-01
Preconditions
Standard, Member and Student prices are one hundred, eighty and sixty dollars
Steps
Assess combining and noncombining twenty-five-percent benefits
Expected
Results are sixty, seventy-five and sixty dollars, with the ineffective code unused and explained
Data
none
Bound to
Source
services-commerce:modules/promotions/tests/unit/pricing/alternatives.spec.js#1. combine = yes, member: $80.00 less 25 % is $60.00 (tax 8 % is $4.80)
02 Bounded combination search handles extra promotionsboundaryunittest
Proves
BR-CAP-COM-CAT-016-03
Preconditions
Five promotions cannot combine with audience prices
Steps
Evaluate the candidate set
Expected
At most sixteen base alternatives are explored; later entries are retained only when they improve the total
Data
none
Bound to
Source
services-commerce:modules/promotions/tests/unit/pricing/alternatives.spec.js#takes one of two when the other loses on its own line: A a better price on the guide, B a worse one on the mug
03 Sequential line benefits precede order benefitsruleunittest
Proves
BR-CAP-COM-CAT-016-04
Preconditions
A hundred-dollar line supports ten-percent and twenty-dollar order benefits
Steps
Evaluate their application
Expected
The result is seventy dollars and subsequent benefits use the prior result
Data
none
Bound to
Source
services-commerce:modules/promotions/tests/unit/pricing/alternatives.spec.js#Q2: line-level before order-level: 10 % and $20 off the order on $100.00 is $70.00, not $72.00
04 Exclusive codes compete against automatic benefitsinteractionunittest
Proves
BR-CAP-COM-CAT-016-05
Preconditions
Automatic Fall pricing and two exclusive VIP benefits exist
Steps
Assess the weaker VIP alone and both VIP codes in either order
Expected
The weak code loses to automatic pricing; the better exclusive wins consistently and conflicts identify the holder
Data
none
Bound to
Source
services-commerce:modules/promotions/tests/unit/pricing/alternatives.spec.js#5. exclusive code against the automatic outcome: VIP5 (5 %) would give $76.00, Fall 10 % gives $72.00; VIP5 is dropped and consumes no use
05 Comparison bases and ties preserve audience pricingedgeunittest
Proves
BR-CAP-COM-CAT-016-06
Preconditions
Alternatives tie and another cart has a minimum threshold
Steps
Assess the alternatives and qualifying subtotal
Expected
The tie retains audience pricing without usage, and minimum qualification uses post-line-discount amounts
Data
none
Bound to
Source
services-commerce:modules/promotions/tests/unit/pricing/alternatives.spec.js#Q4: a tie goes to audience pricing, and the tied code is not used up
06 Discount arithmetic preserves rounded allocationsinvariantunittest
Proves
BR-CAP-COM-CAT-016-08 BR-CAP-COM-CAT-016-09
Preconditions
Amounts support percentage and proportional examples
Steps
Calculate fifteen percent of 3333 and allocate fixed discounts across unequal and equal lines
Expected
Results are 500, allocations 1714/857/429 and 834/833/833
Data
none
Bound to
Source
services-commerce:modules/promotions/tests/unit/pricing/benefits.spec.js#takes 15% off 3333 as 500 (499.95 rounded half up)
07 Item exclusions and shipping caps remain distinctruleunittest
Proves
BR-CAP-COM-CAT-016-10
Preconditions
The cart includes pass-through and promotion-excluded lines
Steps
Apply an item percentage and a shipping benefit
Expected
Only qualifying item lines receive the percentage and shipping reduction stops at zero
Data
none
Bound to
Source
services-commerce:modules/promotions/tests/unit/pricing/apply-promotions.spec.js#never touches a tax, shipping or fee line, nor a product excluded from promotions
08 Refusal order returns private-information-safe messagesvalidationunitnegativetest
Proves
BR-CAP-COM-CAT-016-11 BR-CAP-COM-CAT-016-13
Preconditions
Codes independently fail qualification checks
Steps
Validate each code, including uncertain and anonymous eligibility
Expected
The first applicable reason wins, private values remain hidden, uncertainty refuses and restricted visitors are asked to sign in
Data
none
Bound to
Source
services-commerce:modules/promotions/tests/unit/pricing/validation.spec.js#answers the first refusal in the order of 10.3: an inactive code before an exhausted one
09 Ineffective codes produce no applied benefitedgeunittest
Proves
BR-CAP-COM-CAT-016-12 AS-JNY-COM-CAT-005-02
Preconditions
Codes have zero benefit, wrong business unit or no qualifying item
Steps
Assess each against the cart
Expected
No discount or use is applied and the reason remains reported
Data
none
Bound to
Source
services-commerce:modules/promotions/tests/unit/pricing/apply-promotions.spec.js#refuses a promotion whose benefit is zero on every qualifying line (an amount off a line already free)
10 Alternative explanations identify why a code loses or winsruleunittest
Proves
BR-CAP-COM-CAT-016-14
Preconditions
Codes compete with audience and automatic prices
Steps
Render the comparison messages
Expected
Messages explain the outcome using both totals where applicable
Data
none
Bound to
Source
services-commerce:modules/promotions/tests/unit/pricing/reason-codes.spec.js#says in the customer’s words that the audience price was better, with both totals
11 Selling-area timeout distinguishes preview from placementfailureunitnegativetest
Proves
BR-CAP-COM-CAT-016-15
Preconditions
A part provider cannot answer within its timeout
Steps
Preview the cart and attempt placement
Expected
Preview omits the unavailable parts; placement returns the retry refusal
Data
Fake slow provider
Bound to
Source
services-commerce:modules/promotions/tests/unit/pricing/parts.spec.js#refuses a code promotion_check_unavailable when a part is listed unavailable, and discounts nothing
12 Concurrent usage respects finite capacityconcurrencyapinegativetest
Proves
BR-CAP-COM-CAT-016-16 INV-DOM-COM-CAT-005-10
Preconditions
A code permits one hundred uses
Steps
Run two hundred competing placements
Expected
One hundred succeed, one hundred fail and usage totals remain one hundred
Data
Concurrency harness
Bound to
Source
services-commerce:modules/promotions/tests/integration/services/persistence/redemption-concurrency.integration.spec.js#applies exactly 100 and answers the other 100 code_exhausted
13 Only an applied benefit consumes redemption capacityinteractionapiproposed
Proves
BR-CAP-COM-CAT-016-12 BR-CAP-COM-CAT-016-16 BR-CAP-COM-CAT-017-01 BR-CAP-COM-CAT-017-02
Preconditions
One code loses to a cheaper audience and another wins.
Steps
Place each result and read redemption rows and usage counters.
Expected
Only the winning applied promotion has a redemption and increased counters.
Data
Run-owned workspace and records; fixed clock where dates are exercised.
Source
services-commerce:modules/promotions/tests/unit/pricing/apply-promotions.spec.js#refuses a promotion whose benefit is zero on every qualifying line (an amount off a line already free),services-commerce:modules/promotions/tests/integration/services/persistence/redemption-concurrency.integration.spec.js#applies exactly 100 and answers the other 100 code_exhausted,services-commerce:modules/promotions/tests/integration/services/persistence/promotion-redemptions.integration.spec.js#locks the promotion at its first redemption,services-commerce:modules/promotions/tests/integration/db/redemptions.table.integration.spec.js#refuses at COMMIT a redemption whose discount is not its allocations’ sum, naming the redemption
14 Sample preview agrees with checkout without recording a useinteractionapiproposed
Proves
BR-CAP-COM-CAT-016-02 BR-CAP-COM-CAT-016-15 BR-CAP-COM-CAT-018-01 BR-CAP-COM-CAT-018-03
Preconditions
A combining code and a noncombining code match sample and checkout carts.
Steps
Compare line amounts and explanations, then compare counters and saved rows.
Expected
The exercised price results agree and sample preview adds no checkout or redemption.
Data
Run-owned workspace and records; fixed clock where dates are exercised.
Source
services-commerce:modules/promotions/tests/unit/pricing/alternatives.spec.js#2. combine = no, member: audience pricing $80.00 against $100.00 less 25 % = $75.00; the promotional price wins,services-commerce:modules/promotions/tests/unit/pricing/parts.spec.js#refuses a code promotion_check_unavailable when a part is listed unavailable, and discounts nothing,services-commerce:modules/promotions/tests/e2e/promotion-previews.e2e.spec.js#is, line for line and total for total, what the real checkout preview answers,services-commerce:modules/promotions/tests/e2e/promotion-previews.e2e.spec.js#opens no checkout and writes no item, event, evaluation, redemption, reservation or order

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.