diff --git a/make_post_sell/templates/offer.j2 b/make_post_sell/templates/offer.j2 index 1f7a19c..39a81dd 100644 --- a/make_post_sell/templates/offer.j2 +++ b/make_post_sell/templates/offer.j2 @@ -26,31 +26,16 @@ {% endif %} - {# State-aware notice — explains the current offer state to the viewer - regardless of JS / flash availability. #} - {% if is_declined %} -
-

This offer was below the seller's minimum and was automatically declined — try a higher amount.

-
- {% elif is_withdrawn %} -
-

This offer was withdrawn by the buyer.

-
- {% elif is_expired %} -
-

This offer expired before it was accepted.

-
- {% elif is_paid %} -
-

Paid — this offer is complete.

-
- {% endif %} - {# can_act / is_open notices intentionally absent — the "Your turn" - and "Waiting on the other party · they have X to respond" wells - render directly below and carry the same copy. Same pattern as - the dropped accepted-banner — when there's a follow-on action - block carrying the message, the alert stripe just orphans a - band of color in the middle of the page. #} + {# No mid-page state-notice alerts. The offer-state-badge in the + header well at the top of the page is the single source of + truth for the offer's state — Accepted / Declined / Withdrawn + / Expired / Paid / Cancelled by buyer all surface there. The + orphaned alert stripes (red/blue/green/yellow bands floating + between the header and the action well) used to duplicate that + badge AND, in the declined case, asserted "automatically + declined" copy that was wrong for manually-declined offers. + Everything an offer's viewer needs is in the header badge plus + the action / waiting / pay-now wells below. #} {% if can_act %}
diff --git a/make_post_sell/tests/test_functional.py b/make_post_sell/tests/test_functional.py index 3d1f0f5..31fc2a9 100644 --- a/make_post_sell/tests/test_functional.py +++ b/make_post_sell/tests/test_functional.py @@ -6165,9 +6165,13 @@ class TestOfferRoutes(_AuthenticatedBase): ) self.assertEqual(res.status_int, 403) - def test_offer_page_shows_declined_notice(self): - # 10% of list → auto-declined; the detail page must explain why - # without relying on a flash (capability-driven presentation). + def test_offer_page_shows_declined_state_in_badge(self): + # 10% of list → auto-declined. The state is visible via the + # offer-state-badge in the header well — there's no + # mid-page state-notice alert (those orphaned a stripe of + # colour with hardcoded copy that didn't match reality — + # e.g., asserted "automatically declined" even on manually + # declined offers). product_id = self._make_offer_product(list_price=10000) self.testapp.get("/log-out") self.log_in_user(self.user2_creds) @@ -6175,8 +6179,12 @@ class TestOfferRoutes(_AuthenticatedBase): offer_id = res.json["offer_id"] page = self.testapp.get(f"/o/{offer_id}", status=200) body = page.body.decode() - self.assertIn("offer-state-notice", body) - self.assertIn("automatically declined", body) + # State badge says "Declined" (offer-state-3 = DECLINED). + self.assertIn("offer-state-badge offer-state-3", body) + self.assertIn("Declined", body) + # No mid-page notice stripe. + self.assertNotIn("offer-state-notice", body) + self.assertNotIn("automatically declined", body) def test_offer_page_shows_accepted_notice_with_paynow(self): product_id = self._make_offer_product(list_price=10000)