/* 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", "€563.30", "product page shows the from-price (green supplier + €50)"); srv.BodyHas("/shop/fp6-pmos", "€465.54", "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", "€563.30", "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 — €569.30", "colour selector prices black"); srv.BodyHas("/shop/fp6-pmos", "White — €654.88", "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", "