/* catcrafts.net Copyright (C) 2026 Catcrafts The source code of this website is made available for viewing purposes only. No permission is granted to copy, modify, distribute, or create derivative works. */ // The shop front: prices rendered from the same integers the checkout // charges, the currency conversions the shop card carries, and the copy // around them. Runs in both shop states — coming-soon asserts the closed // shape, launch re-arms the open one with no edit here. import std; import Catcrafts.E2eHarness; using namespace Catcrafts::E2e; int main(int argc, char** argv) { TestServer srv(argv[1], 8216); // The price is rendered from the same integers the checkout charges, with // the derived ex-VAT twin alongside — asserting both pins the arithmetic. srv.BodyHas("/shop/fp6-pmos", "€573.80", "product page shows the from-price (green supplier + €60.50 gross markup)"); srv.BodyHas("/shop/fp6-pmos", "€474.21", "product page shows the derived ex-VAT price"); srv.BodyHas("/shop/fp6-pmos", ">from<", "product page marks the price as a from-price"); srv.BodyHas("/shop", "€573.80", "shop card shows the from-price"); // Every colour is priced in the selector, and the form carries the exact // data blob the preview computes from. srv.BodyHas("/shop/fp6-pmos", "Black €579.80", "colour selector prices black"); srv.BodyHas("/shop/fp6-pmos", "White €665.38", "colour selector prices white"); if (srv.ShopOpen()) { srv.BodyHas("/shop/fp6-pmos", "data-cc=", "form embeds the pricing blob"); srv.BodyHas("/shop/fp6-pmos", "id=\"cc-total\"", "live total element present"); } else { srv.BodyHas("/shop/fp6-pmos", "Coming soon", "coming-soon notice on the buy panel"); srv.BodyHas("/shop", "coming soon", "shop card carries the coming-soon badge"); srv.BodyLacks("/shop/fp6-pmos", "