mirror of
https://github.com/TheRealOwenRees/chess-endgame-trainer.git
synced 2026-11-18 03:32:06 +00:00
Add a public health probe and monitoring runbook (#166)
* move theme picker position in add endgames form * Add branded favicons and web manifest - Replace the placeholder favicon with the knight mark: .ico (16/32/48), SVG, and 16/32 PNGs. - Add opaque apple-touch and Android launcher icons plus a site webmanifest naming the app and using the brand palette. - Link the icon set, manifest, and theme-color from the root layout and the 404/500 pages. - Whitelist the new static files in static_paths/0 and the prelaunch allowlist so they are served in production and behind the gate. - Sync the coming-soon site's favicon.ico and drop the unused Phoenix logo. * Add a public health probe and monitoring runbook Probe https://<PHX_HOST>/health through Cloudflare every two minutes and report to a healthchecks.io check. A healthy run posts the raw health JSON; a tablebase mismatch is a green check-in with the mismatch recorded; a non-200, non-JSON, down database or network failure posts one fail ping with the response body and a loopback cross-check as evidence. --dry-run evaluates the success, degraded, fail, non-JSON and unreachable fixtures without reading config or touching the network. The runbook covers the healthchecks.io check, install, what /health proves, Beszel's blind spot and the drills. * Fix theme picker search after moving it into the endgame form The picker moved inside the endgame form, which nested the component's own <form>. Browsers, and the LiveView test DOM, drop a nested form along with its phx-change and phx-submit bindings, so the search box did nothing and three form tests lost their #theme-form selector. The component now renders no form: phx-change sits on the search input, which works both inside the endgame form and standalone on the bulk importer. The unreachable create_theme_from_search handlers go away; theme creation uses the existing button. Tests search through the input and click that button.
This commit is contained in:
@@ -84,7 +84,10 @@ defmodule ChesstrainerWeb.EndgameLive.FormTest do
|
||||
|
||||
assert html =~ "max-w-2xl"
|
||||
|
||||
view |> form("#theme-form", %{theme_search: "Luc"}) |> render_change()
|
||||
view
|
||||
|> element("#theme-picker input[name='theme_search']")
|
||||
|> render_change(%{theme_search: "Luc"})
|
||||
|
||||
view |> element("button", "Lucena") |> render_click()
|
||||
|
||||
view
|
||||
@@ -109,10 +112,16 @@ defmodule ChesstrainerWeb.EndgameLive.FormTest do
|
||||
|
||||
{:ok, view, _html} = live(conn, ~p"/admin/endgames/new")
|
||||
|
||||
view |> form("#theme-form", %{theme_search: "Luc"}) |> render_change()
|
||||
view
|
||||
|> element("#theme-picker input[name='theme_search']")
|
||||
|> render_change(%{theme_search: "Luc"})
|
||||
|
||||
view |> element("button", "Lucena") |> render_click()
|
||||
|
||||
view |> form("#theme-form", %{theme_search: "Phil"}) |> render_change()
|
||||
view
|
||||
|> element("#theme-picker input[name='theme_search']")
|
||||
|> render_change(%{theme_search: "Phil"})
|
||||
|
||||
view |> element("button", "Philidor") |> render_click()
|
||||
|
||||
html = render(view)
|
||||
@@ -123,7 +132,11 @@ defmodule ChesstrainerWeb.EndgameLive.FormTest do
|
||||
test "creates and attaches a new theme inline", %{conn: conn} do
|
||||
{:ok, view, _html} = live(conn, ~p"/admin/endgames/new")
|
||||
|
||||
view |> form("#theme-form", %{theme_search: "Lucerne"}) |> render_submit()
|
||||
view
|
||||
|> element("#theme-picker input[name='theme_search']")
|
||||
|> render_change(%{theme_search: "Lucerne"})
|
||||
|
||||
view |> element("button", ~s(Create theme "Lucerne")) |> render_click()
|
||||
|
||||
assert render(view) =~ "Lucerne"
|
||||
assert [%{name: "Lucerne"}] = Themes.search("Lucerne", "endgame")
|
||||
|
||||
@@ -35,7 +35,10 @@ defmodule ChesstrainerWeb.EndgameLive.ImportTest do
|
||||
assert html =~ "KR v K"
|
||||
assert html =~ "win"
|
||||
|
||||
view |> form("#theme-form", %{theme_search: "Luc"}) |> render_change()
|
||||
view
|
||||
|> element("#theme-picker input[name='theme_search']")
|
||||
|> render_change(%{theme_search: "Luc"})
|
||||
|
||||
view |> element("button", "Lucena") |> render_click()
|
||||
|
||||
view |> element("button", "Import 1 endgame(s)") |> render_click()
|
||||
|
||||
Reference in New Issue
Block a user