---
id: TST-COM-ORD-122
title: 'The promotion amendment plan: the lines it judges'
kind: unit
product_area: commerce
module: orders
revision: 1
status: draft
source_sha:
  services-commerce: c8b66a98e2490617aec38ba5c8165dd9bd0a8f9b
repository: services-commerce
files:
  - modules/orders/tests/unit/amendments/promotion-amendment-plan.spec.js
implements: []
environment: mock
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 1
isolation: 'The suite owns its in-memory inputs, scripted responses and rendered component state.'
evidence:
  - provenance: test
    source: 'services-commerce:modules/orders/tests/unit/amendments/promotion-amendment-plan.spec.js'
    test_cases:
      - 'judges the open item lines with units standing, never a cancelled line nor a tax line'
      - 'takes 10% of each standing line’s placed gross price: 250 off a 2500 T-shirt and 100 off a 1000 mug'
      - 'judges a partly cancelled line on its standing units alone: 2 of 3 at 1000 give 200'
      - >-
        computes on the line net of a placed allocation, after it in sequence: 10% of 2000 once 500 was taken
        at placement
      - writes the line’s discount and net after the code under the totals identity
      - memos a paid line’s share on its invoice line and frees all of it
      - 'lets an unpaid line’s balance absorb its memo: nothing is freed'
      - 'frees a partly paid line’s memo only beyond what is still due: 250 against 100 due frees 150'
      - 'never frees more than was paid and kept: a line refunded meanwhile frees what is left'
      - 'memos nothing for a line not yet billed: the invoice will carry the discount'
      - refuses a code the tenant does not have with the not-found rejection it is given
      - refuses an exhausted code code_exhausted
      - refuses a code whose window closed expired
      - refuses a code scoped to none of the lines nothing_qualifies
      - refuses the promotion the order already carries already_applied
      - leaves a line whose product is excluded from promotions alone
      - >-
        EARLY25 (25 % off, does not combine) takes the Standard price $100.00 to $75.00, lower than Jane’s
        $80.00: she saves $5.00
      - >-
        EARLY25 that combines takes 25 % off the Member price $80.00, $60.00: she saves $20.00, never both
        prices
      - >-
        refuses a code that does not combine when the audience price is lower than the promotional price,
        explaining why
      - 'refuses it for an order placed before the Standard price was stored, with the staff message'
      - does not need the stored Standard price of a line the code does not discount
      - judges the standing units of a partly cancelled line on their share of the Standard price
      - >-
        refuses a code that would raise the price of a line already placed, since an amendment never raises a
        price
      - plans a code that combines as ever
      - 'carries the provider’s answer on each planned line, to be frozen with the new allocation'
      - 'refuses a code whose provider did not answer for a part: the library never guesses'
      - >-
        refuses a shipping offer: it discounts the shipping charge rated at checkout, not an order already
        placed
      - 'reads a shipping allocation of the order as context without trouble: it is on no standing line'
scenario_coverage: []
dependency_evidence:
  provenance: test
  source: 'services-commerce:modules/orders/tests/unit/amendments/promotion-amendment-plan.spec.js'
  declared_by_test: 'the plan and the pricing library. Doubled: nothing (the inputs are literals).'
---

# The promotion amendment plan: the lines it judges

## Verification Boundary

The unit suite checks the named contract or helper with controlled inputs.

## What This Suite Proves

The registered cases check the promotion amendment plan: the lines it judges with their fixture records and assertions. Scenario bindings name only the examples those cases exercise.

## What It Does Not Prove

A registered file supplies no run result or verified conformance by itself. Local fixtures do not establish deployed cross-service behavior or complete browser journeys.

## Real Dependencies and Test Doubles

Inputs and external responses are controlled in process; this suite establishes no deployed service behavior.

## Must Not Be Doubled

The named contract validation or component behavior under assertion must use its actual implementation.
