feat: add Cart page and themed error pages

- Add ShopLive.Cart at /cart using shared PageTemplates
- Update ErrorHTML to render fully themed 404/500 pages
- Add dev-only error preview routes at /dev/errors/404 and /dev/errors/500
- Update error page tests for themed output

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-17 22:29:45 +00:00
parent 94f98b8be0
commit a2d655d302
5 changed files with 210 additions and 15 deletions

View File

@@ -4,11 +4,17 @@ defmodule SimpleshopThemeWeb.ErrorHTMLTest do
# Bring render_to_string/4 for testing custom views
import Phoenix.Template, only: [render_to_string: 4]
test "renders 404.html" do
assert render_to_string(SimpleshopThemeWeb.ErrorHTML, "404", "html", []) == "Not Found"
test "renders 404.html with themed page" do
html = render_to_string(SimpleshopThemeWeb.ErrorHTML, "404", "html", [])
assert html =~ "404"
assert html =~ "Page Not Found"
assert html =~ "shop-root"
end
test "renders 500.html" do
assert render_to_string(SimpleshopThemeWeb.ErrorHTML, "500", "html", []) == "Internal Server Error"
test "renders 500.html with themed page" do
html = render_to_string(SimpleshopThemeWeb.ErrorHTML, "500", "html", [])
assert html =~ "500"
assert html =~ "Server Error"
assert html =~ "shop-root"
end
end