Skip to content

ATS-COM-CAT-016Choose the best permitted promotional result: Acceptance Test Set

Markdown

ATS-COM-CAT-016

Choose the best permitted promotional result: Acceptance Test Set

Markdown
  • DocumentProposed

Planning

Proves capability
CAP-COM-CAT-016

KindAcceptance test setProduct areaCommerceModuleCatalog and Selling ConfigurationRevision1

Read atservices-commerce c8b66a98react-console baf6dae3

Test Scenarios

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

01 Alternative pricing matches the decision’s examplesunittest
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
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)
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/alternatives.spec.js#3. combine = no, student at $60.00: audience pricing wins, EARLY25 consumes no use, and the buyer is told why
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 promotionsunittest
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
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
services-commerce:modules/promotions/tests/unit/pricing/alternatives.spec.js#tries the fifth and later one at a time in entry order
services-commerce:modules/promotions/tests/unit/pricing/alternatives.spec.js#leaves the fifth unused when it does not lower the total
services-commerce:modules/promotions/tests/unit/pricing/alternatives.spec.js#asks for at most sixteen distinct alternatives when four promotions stay off audience prices
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 benefitsunittest
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
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
services-commerce:modules/promotions/tests/unit/pricing/stacking.spec.js#puts automatic promotions first by priority, then the codes in the order entered
services-commerce:modules/promotions/tests/unit/pricing/stacking.spec.js#J16: an automatic 10% stackable then a 15% stackable code on 20000 give 2000 then 2700, net 15300
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 benefitsunittest
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
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
services-commerce:modules/promotions/tests/unit/pricing/alternatives.spec.js#Q5: every combination of the exclusive codes: the better of two exclusive codes wins whatever the order entered
services-commerce:modules/promotions/tests/unit/pricing/alternatives.spec.js#Q5: the exclusive code that loses to another is refused, naming the one that holds the line
services-commerce:modules/promotions/tests/unit/pricing/stacking.spec.js#refuses any promotion on a line an exclusive one holds
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 pricingunittest
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
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
services-commerce:modules/promotions/tests/unit/pricing/alternatives.spec.js#Q7: the comparison is the order total before tax and shipping
services-commerce:modules/promotions/tests/unit/pricing/alternatives.spec.js#Q3: the minimum order is measured on the qualifying lines after the line-level promotions
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 allocationsunittest
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
services-commerce:modules/promotions/tests/unit/pricing/benefits.spec.js#takes 15% off 3333 as 500 (499.95 rounded half up)
services-commerce:modules/promotions/tests/unit/pricing/allocation.spec.js#shares 3000 over 10000, 5000 and 2500 as 1714, 857, 429: the largest fraction gets the unit
services-commerce:modules/promotions/tests/unit/pricing/allocation.spec.js#shares 2500 over three 10000 lines as 834, 833, 833: the tie goes to the first line
services-commerce:modules/promotions/tests/unit/pricing/allocation.spec.js#sums to the amount exactly, every part its floor or one more and never above its basis, ties to the earlier line
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 distinctunittest
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
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
services-commerce:modules/promotions/tests/unit/pricing/shipping-offers.spec.js#caps amount_off_shipping at the charge and never takes it below zero
services-commerce:modules/promotions/tests/unit/pricing/parts.spec.js#leaves a line excluded from promotions out of every part, whatever the provider says
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 messagesunitnegativetest
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
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
services-commerce:modules/promotions/tests/unit/pricing/validation.spec.js#keeps the limit, the owner and the rule out of every customer message
services-commerce:modules/promotions/tests/unit/pricing/validation.spec.js#fails closed on an indeterminate verdict, for must_match and for must_not_match alike
services-commerce:modules/promotions/tests/unit/pricing/validation.spec.js#asks an anonymous purchaser to sign in for an eligibility rule (J15), before refusing it as ineligible
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 benefitunittest
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
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/unit/pricing/apply-promotions.spec.js#J14: refuses a promotion of another business unit with the staff reason business unit
services-commerce:modules/promotions/tests/unit/pricing/alternatives.spec.js#records as applied only the promotions that gave a discount; a code that gave nothing is rejected and not applied
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 winsunittest
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
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
services-commerce:modules/promotions/tests/unit/pricing/reason-codes.spec.js#says, the reverse, that the promotional price was lower than the audience price
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 placementunitnegativetest
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
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/unit/pricing/parts.spec.js#simply does not apply an automatic promotion with an unavailable part, and reports nothing
services-commerce:modules/promotions/tests/unit/areas/area-registry.spec.js#cuts a slow provider at the timeout and makes its parts unavailable
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 capacityapinegativetest
Proves
BR-CAP-COM-CAT-016-16
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

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.