---
id: TST-COM-ORD-051
title: 'DiscountableLinesOf: the engine’s priced items as the library’s lines'
kind: unit
product_area: commerce
module: orders
revision: 1
status: draft
source_sha:
  services-commerce: c8b66a98e2490617aec38ba5c8165dd9bd0a8f9b
repository: services-commerce
files:
  - modules/checkout/tests/unit/checkout/checkout-promotions.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/checkout/tests/unit/checkout/checkout-promotions.spec.js'
    test_cases:
      - >-
        maps each priced item to an item line whose basis is the engine’s line total, with its product,
        quantity and recipient
      - 'carries the product’s exclude_from_promotions from the port, keyed by product type and product'
      - refuses a priced item the checkout does not hold
      - >-
        makes the subtotal the line totals gross, the discount the engine’s plus the promotions’, the total
        subtotal − discount + fee
      - >-
        J1: 45000 with EARLY25 is a subtotal of 45000, a discount of 2500 and a total of 42500 (tax 0 until
        P3-WP05)
      - >-
        holds the order identity over the lines: Σ (net + discount) is the subtotal and Σ line discount + the
        engine’s is the discount
      - puts the port’s code_not_found among the library’s rejections in the order the codes were entered
      - >-
        records per item the gross line total, the promotions’ discount, the net line total and each discount
        row
      - records the totals with the engine’s order discount and the promotions’ apart
      - 'records the promotions applied, rejected (both messages) and replaced, in the shape of §10.2'
      - >-
        writes one row per entered code in entry order: applied with its allocation preview, rejected with its
        reason
      - 'answers the lines with their discounts, the promotions and the totals of §10.2'
      - 'J14: tells a console actor the staff message naming the business unit'
      - 'J14: tells a portal member the customer message alone, which does not say business unit'
      - keeps the staff message in the snapshot a console actor reads (premise of the redaction)
      - takes the staff message out of the snapshot a portal member reads
      - answers no breakdown for a checkout never priced
      - 'gives each line its Standard basis beside its own, when the Standard run priced it'
      - >-
        prices the Standard basis only when a candidate does not combine and some line is not already at
        Standard
      - >-
        takes the Standard run’s line when the promotion was priced from it: $100.00 less 25 % is $75.00,
        below the Member $80.00
      - 'taxes the winning price: the tax step takes the line net of its discount from the Standard basis'
      - >-
        keeps the audience basis, and the same priced checkout, when the promotion lost: the Member $80.00
        against $75.00 less
      - records the snapshot with the basis of each line and the explanation of the code that gave nothing
      - >-
        tells a console actor the staff message of an explanation and a portal member the customer message
        alone
      - 'writes a code that gave nothing as a rejected row with the explanation as its reason, and no discount'
      - >-
        chooses on the mixed alternative's own run: the audience run's $5.00 order discount does not carry
        over to it
      - >-
        takes the mixed alternative when its own run answers a bigger discount, and carries that run's
        adjustment to the priced checkout
      - 'hands the review the alternative’s lines, each at its own basis'
      - >-
        runs the extension once per distinct alternative however many exclusive-code combinations compare
        inside it
      - >-
        reuses the Standard run for the alternative that moves every line the Standard price changes, and the
        audience run for none
      - takes the audience run’s order-level adjustment for every alternative when no review is given
      - keeps the runs it made so that placement judges the same alternatives from the same answers
      - 'refuses the evaluation, as the run does, when the extension of an alternative fails'
      - 'shares the $30.00 over the lines as 17.14, 8.57 and 4.29'
      - 'hands the tax step each line net of its share: 82.86, 41.43 and 20.71'
      - 'taxes each of those lines at 8 %: 6.63, 3.31 and 1.66, summing to 11.60'
      - 'makes the order total the lines’ net plus their tax: 145.00 + 11.60'
scenario_coverage: []
dependency_evidence:
  provenance: test
  source: 'services-commerce:modules/checkout/tests/unit/checkout/checkout-promotions.spec.js'
  declared_by_test: >-
    the functions and the promotion library. Doubled: the engine's answer and the checkout's items, as
    literals.
---

# DiscountableLinesOf: the engine’s priced items as the library’s lines

## Verification Boundary

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

## What This Suite Proves

The registered cases check discountableLinesOf: the engine’s priced items as the library’s lines 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.
