CartDisplay Discount Logic Test
Test Scenario:
Normal BOGO + Coupon
Fallback Calculation (Missing BOGO data)
Fallback Calculation Fails
No BOGO, Regular Discount
Zero Amount Discount
BOGO Calculation Fails
Current Scenario: normal
Check the console for any warnings. Look for discount display behavior.
Test Product 1
-
+
Remove
£50
Test Product 2
-
+
Remove
£50
Coupon Code
Apply
Order Summary
Subtotal
£100
Heinrich Coupon Applied
-£10
Buy One Get One (10% off)
-£5
Total discount:
-£15
Shipping
Calculated at next step
Total
£85
Including £NaN VAT
Expected Behaviors:
Normal:
Shows BOGO amount (calculated from data) + coupon + total
Fallback Calculation:
Shows BOGO amount (£5 = £20 total - £15 coupon)
Fallback Fails:
Shows "Applied" + console warning (negative calculation)
No BOGO:
Shows only regular discount + total discount
Zero Amount:
Shows "Applied" instead of £0.00
Calculation Fails:
Shows "Applied" for BOGO (no matching products)