towerops/test/towerops_web/controllers/page_controller_test.exs
Graham McIntie 635d89d774 Fix mobile Gaiia entity mapping + redirect / to /dashboard
- Entity mapping table: hide Gaiia ID and Linked columns on mobile,
  show Gaiia ID inline under name on small screens
- Allow text wrapping in name column for long names
- Add overflow-x-auto to table container for safety
- Redirect authenticated users from / to /dashboard instead of /orgs
2026-02-15 15:05:20 -06:00

57 lines
1.5 KiB
Elixir

defmodule ToweropsWeb.PageControllerTest do
use ToweropsWeb.ConnCase
import Towerops.AccountsFixtures
test "GET / renders marketing page when not authenticated", %{conn: conn} do
conn = get(conn, ~p"/")
assert html_response(conn, 200) =~ "business impact"
assert html_response(conn, 200) =~ "network event"
end
test "GET / redirects to organizations when authenticated", %{conn: conn} do
user = user_fixture()
conn = log_in_user(conn, user)
conn = get(conn, ~p"/")
assert redirected_to(conn) == ~p"/dashboard"
end
test "GET /privacy renders privacy policy page", %{conn: conn} do
conn = get(conn, ~p"/privacy")
response = html_response(conn, 200)
assert response =~ "Privacy Policy"
# Should render the privacy policy template
assert response
end
test "GET /privacy renders for authenticated users", %{conn: conn} do
user = user_fixture()
conn = log_in_user(conn, user)
conn = get(conn, ~p"/privacy")
response = html_response(conn, 200)
assert response =~ "Privacy Policy"
end
test "GET /terms renders terms of service page", %{conn: conn} do
conn = get(conn, ~p"/terms")
response = html_response(conn, 200)
assert response =~ "Terms of Service"
# Should render the terms template
assert response
end
test "GET /terms renders for authenticated users", %{conn: conn} do
user = user_fixture()
conn = log_in_user(conn, user)
conn = get(conn, ~p"/terms")
response = html_response(conn, 200)
assert response =~ "Terms of Service"
end
end