From 16bbf07dd5a3164e0765d230be8b378081b4f8ba Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Sat, 9 May 2026 10:07:45 -0500 Subject: [PATCH] test: UserResetPasswordLive HIBP check_password_breach with value branch --- test/towerops_web/live/user_reset_password_live_test.exs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/towerops_web/live/user_reset_password_live_test.exs b/test/towerops_web/live/user_reset_password_live_test.exs index fccdf49b..c793567f 100644 --- a/test/towerops_web/live/user_reset_password_live_test.exs +++ b/test/towerops_web/live/user_reset_password_live_test.exs @@ -78,5 +78,13 @@ defmodule ToweropsWeb.UserResetPasswordLiveTest do assert render_hook(lv, "check_password_breach", %{}) 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