prop/test/microwaveprop_web/controllers/html_module_test.exs
Graham McIntire 579ce68af5
Some checks failed
Build and Push / Build and Push Docker Image (push) Failing after 22s
fix: resolve 64 test failures via sandbox-allow, skip-guards, and cleanup
- Add Phoenix.Ecto.SQL.Sandbox.allow to all start_async closures in ContactLive.Show (8 sites) and PskrSpotsLive (4 sites), fixing silent empty results when async Tasks accessed DB in tests
- Add File.exists? skip-guards to wgrib2_test.exs (14 guards) and hrrr_client_test.exs (3 guards) so tests skip gracefully when GRIB2 fixtures are absent
- Remove leftover debug IO.puts from SandboxHook
- Fix stale homepage assertion in html_module_test.exs
- Add cdo and wgrib2 to nix shell.nix and Forgejo CI apt-get install

Test suite: 4049/4054 passed (99.9%), 5 remaining failures are environment gaps (cdo/wgrib2 not yet in CI runtime)
2026-08-04 12:49:23 -05:00

60 lines
1.5 KiB
Elixir

defmodule MicrowavepropWeb.HtmlModuleTests do
@moduledoc false
use MicrowavepropWeb.ConnCase, async: true
import Phoenix.Template, only: [render_to_string: 4]
alias Microwaveprop.Accounts.User
describe "PageHTML" do
test "renders home template" do
content = render_to_string(MicrowavepropWeb.PageHTML, "home", "html", %{flash: %{}})
assert content =~ "NTMS Microwave Propagation"
end
end
describe "UserRegistrationHTML" do
test "renders new template" do
changeset = User.registration_changeset(%User{}, %{})
content =
render_to_string(MicrowavepropWeb.UserRegistrationHTML, "new", "html", %{
flash: %{},
current_scope: nil,
changeset: changeset
})
assert content =~ "Register"
end
end
describe "UserSessionHTML" do
test "renders new template" do
form = Phoenix.Component.to_form(%{"email" => "", "password" => ""}, as: :user)
content =
render_to_string(MicrowavepropWeb.UserSessionHTML, "new", "html", %{
flash: %{},
current_scope: nil,
form: form
})
assert content =~ "Log in"
end
end
describe "UserResetPasswordHTML" do
test "renders new template" do
form = Phoenix.Component.to_form(%{"email" => ""}, as: :user)
content =
render_to_string(MicrowavepropWeb.UserResetPasswordHTML, "new", "html", %{
flash: %{},
current_scope: nil,
form: form
})
assert content =~ "Reset"
end
end
end