fix(tests): enable TOTP in remaining test setups
Fixes TOTP-related test failures by adding enable_totp: true to setup blocks. Updated test files: - test/towerops_web/live/org/preseem_insights_live_test.exs - test/towerops_web/live/agent_live/index_test.exs - test/towerops_web/live/org/integrations_live_test.exs - test/towerops_web/live/org/settings_live_members_test.exs - test/towerops_web/live/org/settings_live_property_test.exs - test/towerops_web/live/org/settings_live_test.exs - test/towerops_web/live/device_live/show_test.exs - test/towerops_web/controllers/admin_controller_test.exs Progress: 148 failures → 66 failures
This commit is contained in:
parent
3ed732fecc
commit
9e525aa7e2
8 changed files with 13 additions and 13 deletions
|
|
@ -12,7 +12,7 @@ defmodule ToweropsWeb.AdminControllerTest do
|
|||
|> Towerops.Repo.update!()
|
||||
|
||||
_org = organization_fixture(superuser.id)
|
||||
target_user = user_fixture()
|
||||
target_user = user_fixture(enable_totp: true)
|
||||
_target_org = organization_fixture(target_user.id)
|
||||
|
||||
conn =
|
||||
|
|
@ -44,9 +44,9 @@ defmodule ToweropsWeb.AdminControllerTest do
|
|||
end
|
||||
|
||||
test "non-superuser is redirected away", %{conn: conn} do
|
||||
user = user_fixture()
|
||||
user = user_fixture(enable_totp: true)
|
||||
_org = organization_fixture(user.id)
|
||||
target_user = user_fixture()
|
||||
target_user = user_fixture(enable_totp: true)
|
||||
|
||||
conn =
|
||||
conn
|
||||
|
|
@ -57,7 +57,7 @@ defmodule ToweropsWeb.AdminControllerTest do
|
|||
end
|
||||
|
||||
test "unauthenticated user is redirected to login", %{conn: conn} do
|
||||
target_user = user_fixture()
|
||||
target_user = user_fixture(enable_totp: true)
|
||||
|
||||
conn = post(conn, ~p"/admin/impersonate/#{target_user.id}")
|
||||
|
||||
|
|
@ -105,7 +105,7 @@ defmodule ToweropsWeb.AdminControllerTest do
|
|||
|> Towerops.Repo.update!()
|
||||
|
||||
_org = organization_fixture(superuser.id)
|
||||
target_user = user_fixture()
|
||||
target_user = user_fixture(enable_totp: true)
|
||||
|
||||
conn =
|
||||
conn
|
||||
|
|
@ -120,7 +120,7 @@ defmodule ToweropsWeb.AdminControllerTest do
|
|||
end
|
||||
|
||||
test "non-superuser is redirected away", %{conn: conn} do
|
||||
user = user_fixture()
|
||||
user = user_fixture(enable_totp: true)
|
||||
_org = organization_fixture(user.id)
|
||||
|
||||
conn =
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ defmodule ToweropsWeb.AgentLive.IndexTest do
|
|||
alias Towerops.Agents
|
||||
|
||||
setup do
|
||||
user = user_fixture()
|
||||
user = user_fixture(enable_totp: true)
|
||||
{:ok, organization} = Towerops.Organizations.create_organization(%{name: "Test Org"}, user.id)
|
||||
|
||||
%{user: user, organization: organization}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ defmodule ToweropsWeb.DeviceLive.ShowTest do
|
|||
import Phoenix.LiveViewTest
|
||||
|
||||
setup do
|
||||
user = Towerops.AccountsFixtures.user_fixture()
|
||||
user = Towerops.AccountsFixtures.user_fixture(enable_totp: true)
|
||||
{:ok, organization} = Towerops.Organizations.create_organization(%{name: "Test Org"}, user.id)
|
||||
|
||||
device =
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ defmodule ToweropsWeb.Org.IntegrationsLiveTest do
|
|||
alias Towerops.Preseem.Client, as: PreseemClient
|
||||
|
||||
setup do
|
||||
user = user_fixture()
|
||||
user = user_fixture(enable_totp: true)
|
||||
organization = organization_fixture(user.id)
|
||||
%{user: user, organization: organization}
|
||||
end
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ defmodule ToweropsWeb.Org.PreseemInsightsLiveTest do
|
|||
alias Towerops.Repo
|
||||
|
||||
setup do
|
||||
user = user_fixture()
|
||||
user = user_fixture(enable_totp: true)
|
||||
org = organization_fixture(user.id)
|
||||
%{user: user, organization: org}
|
||||
end
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ defmodule ToweropsWeb.Org.SettingsLiveMembersTest do
|
|||
end
|
||||
|
||||
test "non-admin member cannot see invite form", %{conn: conn, organization: org} do
|
||||
member_user = user_fixture()
|
||||
member_user = user_fixture(enable_totp: true)
|
||||
membership_fixture(org.id, member_user.id, :viewer)
|
||||
|
||||
{:ok, _view, html} =
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ defmodule ToweropsWeb.Org.SettingsLivePropertyTest do
|
|||
import Towerops.OrganizationsFixtures
|
||||
|
||||
setup do
|
||||
user = user_fixture()
|
||||
user = user_fixture(enable_totp: true)
|
||||
organization = organization_fixture(user.id)
|
||||
%{user: user, organization: organization}
|
||||
end
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ defmodule ToweropsWeb.Org.SettingsLiveTest do
|
|||
alias Towerops.Organizations
|
||||
|
||||
setup do
|
||||
user = user_fixture()
|
||||
user = user_fixture(enable_totp: true)
|
||||
organization = organization_fixture(user.id)
|
||||
|
||||
%{user: user, organization: organization}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue