test: UserResetPasswordLive HIBP check_password_breach with value branch

This commit is contained in:
Graham McIntire 2026-05-09 10:07:45 -05:00
parent 84c839a218
commit 16bbf07dd5

View file

@ -78,5 +78,13 @@ defmodule ToweropsWeb.UserResetPasswordLiveTest do
assert render_hook(lv, "check_password_breach", %{}) assert render_hook(lv, "check_password_breach", %{})
end end
test "check_password_breach event with a value drives the HIBP path", %{conn: conn, token: token} do
{:ok, lv, _html} = live(conn, ~p"/users/reset-password/#{token}")
# The HIBP path either returns a count or :unknown — both branches are
# safe and the LiveView must stay alive.
assert render_hook(lv, "check_password_breach", %{"value" => "Anything-NonEmpty-Pass!"})
end
end end
end end