Skip to main content

max / makenotwork

server: update embed price assertions to canonical format (Run 2 UX follow-up) The embed price change (8fb3d76) routes prices through format_price, which renders whole dollars as "$5"/"$15" rather than "$5.00"/"$15.00". Two embed tests still asserted the old f64 format; update them to the canonical output. The non-whole "$19.99" assertion is unchanged (format_price keeps cents). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Author: Max Johnson <me@maxj.phd> · 2026-06-23 17:23 UTC
Commit: 3d162e9f991160508b28cd3443ac39df0da6b384
Parent: cb8adae
1 file changed, +4 insertions, -3 deletions
@@ -171,8 +171,8 @@ async fn item_button_pwyw_renders_plus_suffix() {
171 171 let resp = h.client.get(&format!("/embed/i/{}/button", setup.item_id)).await;
172 172 assert!(resp.status.is_success());
173 173 assert!(
174 - resp.text.contains("$5.00+"),
175 - "PWYW pricing should append `+` to the price"
174 + resp.text.contains("$5+"),
175 + "PWYW pricing should append `+` to the canonical price (whole dollars render as $5, not $5.00)"
176 176 );
177 177 }
178 178
@@ -186,7 +186,8 @@ async fn item_card_renders_with_vertical_layout_by_default() {
186 186 let resp = h.client.get(&format!("/embed/i/{item_id}/card")).await;
187 187 assert!(resp.status.is_success(), "{} {}", resp.status, resp.text);
188 188 assert!(resp.text.contains("Card Title"));
189 - assert!(resp.text.contains("$15.00"));
189 + // Canonical formatter renders whole dollars without trailing .00.
190 + assert!(resp.text.contains("$15"));
190 191 // Vertical layout sets flex-direction: column.
191 192 assert!(
192 193 resp.text.contains("column"),