Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joaodiaslobo committed Jan 8, 2025
1 parent 31afc3f commit df75ee5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions test/safira_web/live/user_login_live_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ defmodule SafiraWeb.UserLoginLiveTest do
import Phoenix.LiveViewTest
import Safira.AccountsFixtures

alias Safira.Event

describe "Log in page" do
test "redirects if already logged in", %{conn: conn} do
result =
Expand Down Expand Up @@ -51,6 +53,8 @@ defmodule SafiraWeb.UserLoginLiveTest do

describe "login navigation" do
test "redirects to registration page when the Register button is clicked", %{conn: conn} do
Event.change_registrations_open(true)

{:ok, lv, _html} = live(conn, ~p"/users/log_in")

{:ok, _login_live, login_html} =
Expand Down
4 changes: 3 additions & 1 deletion test/safira_web/live/user_reset_password_live_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule SafiraWeb.UserResetPasswordLiveTest do
import Phoenix.LiveViewTest
import Safira.AccountsFixtures

alias Safira.Accounts
alias Safira.{Accounts, Event}

setup do
user = user_fixture()
Expand All @@ -14,6 +14,8 @@ defmodule SafiraWeb.UserResetPasswordLiveTest do
Accounts.deliver_user_reset_password_instructions(user, url)
end)

Event.change_registrations_open(true)

%{token: token, user: user}
end

Expand Down

0 comments on commit df75ee5

Please sign in to comment.