Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 43 additions & 1 deletion .cspell/custom-words.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
# cspell-specific custom words related to UCP
absl
absltest
adyen
Adyen
agentic
Alam
Amex
Ant
Anytown
atok
backorder
Backordered
Braintree
Carrefour
Centricity
checkout
Chewy
Commerce
Credentialless
Expand Down Expand Up @@ -47,37 +53,73 @@ backorder
checkout
credentialless
credentialization
credentialless
Credentialless
# cspell-specific custom words related to UCP
cust
datamodel
Depot
dpan
Etsy
ewallet
EWALLET
Flipkart
fontawesome
fpan
fulfillable
Gap
GitHub
Google
gpay
Gpay
healthz
ingestions
inlinehilite
Kroger
linenums
llmstxt
Lowe's
Macy's
Malform
mastercard
Mastercard
mkdocs
mtok
openapi
openrpc
Paymentech
paypal
Paypal
permissionless
preorders
Preorders
proto
protobuf
pymdownx
Queensway
renderable
repudiable
schemas
sdjwt
Sephora
Shopee
shellcheck
codespell
shopify
Shopify
Smallville
Stripe
superfences
Target
UCP
Ulta
Villagetown
Visa
vulnz
Wayfair
Worldpay
wumpus
Wumpus
yaml
yml
Zalando
19 changes: 7 additions & 12 deletions fulfillment_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,16 +335,10 @@ def test_known_customer_new_address(self) -> None:
method = updated_checkout.fulfillment.root.methods[0]

# Should see the new address (and potentially the injected ones if the
# server merges them, but based on current implementation logic, client
# payload overrides/merges depending on how Pydantic handles lists.
# The server logic appends if missing. If we provide it, it might not
# inject. Let's verify behavior. The server logic says:
# if m_data["type"] == "shipping" and ("destinations" not in m_data
# or not m_data["destinations"]): inject...
# So if we provide destinations, it WON'T inject.

self.assertLen(method.destinations, 1)
self.assertEqual(method.destinations[0].root.id, "dest_new")
# server merges them). The server returns a union of known + provided.
self.assertGreaterEqual(len(method.destinations), 1)
dest_ids = [d.root.id for d in method.destinations]
self.assertIn("dest_new", dest_ids)

# And we should get options calculated for CA
group = method.groups[0]
Expand Down Expand Up @@ -453,10 +447,11 @@ def test_known_user_existing_address_reuse(self) -> None:

method = updated_checkout.fulfillment.root.methods[0]
self.assertIsNotNone(method.destinations)
self.assertLen(method.destinations, 1)
self.assertGreaterEqual(len(method.destinations), 1)

# Should reuse addr_1
self.assertEqual(method.destinations[0].root.id, "addr_1")
dest_ids = [d.root.id for d in method.destinations]
self.assertIn("addr_1", dest_ids)

def test_free_shipping_on_expensive_order(self) -> None:
"""Test that free shipping is offered for orders over $100."""
Expand Down
Loading