add variants to all mock products and fix CSSCache race condition

All 16 mock products now have at least one variant so add-to-cart works
in demo mode. CSSCache.invalidate/0 rescues ArgumentError when the ETS
table doesn't exist yet (seed_defaults runs before CSSCache starts).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jamey
2026-02-09 18:12:57 +00:00
parent 90b0242a06
commit 19b4a5bd59
3 changed files with 151 additions and 17 deletions

View File

@@ -103,11 +103,11 @@ defmodule SimpleshopThemeWeb.ShopLive.ProductShowTest do
assert html =~ "disabled"
end
test "shows 'One size' for products without options", %{conn: conn} do
# Product "2" (Ocean Waves Art Print) has no option_types
test "shows single variant for products with one option", %{conn: conn} do
# Product "2" (Ocean Waves Art Print) has a single size variant
{:ok, _view, html} = live(conn, ~p"/products/2")
assert html =~ "One size"
assert html =~ "12×18"
end
end