Skip to content

[Test] The title half of the priced-but-untitled checkout rejection is untested #155

Description

@vedanshujain

createOrderFromCart rejects a line whose product has no title — the same
PRODUCT_NOT_PRICED rejection it uses for a missing price
(packages/domain/src/orders/create-order-from-cart.ts). The price half of that guard is
covered by tests. The title half is not covered anywhere.

That matters because product_commerce.title is a derived cache written only by the CMS content
sync: a product can legitimately exist priced-but-untitled (created through a path that never
carried a title, or a sync that failed), and the guard rejecting it at checkout is the last line
of defence for the order-line snapshot. Nothing pins it, so a future refactor could turn the
rejection into a null title on an order line without a single test going red.

Add a case that places a checkout against a priced product whose title is NULL and asserts the
PRODUCT_NOT_PRICED rejection.

Source: plans/one-home-per-field.md §7.0, §9.5, §9.7.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions