diff --git a/test/towerops_web/live/alert_live_test.exs b/test/towerops_web/live/alert_live_test.exs index 9194177d..59b5bc86 100644 --- a/test/towerops_web/live/alert_live_test.exs +++ b/test/towerops_web/live/alert_live_test.exs @@ -30,7 +30,6 @@ defmodule ToweropsWeb.AlertLive.IndexTest do {:ok, _view, html} = live(conn, ~p"/alerts") assert html =~ "Alerts" - assert html =~ "Triage alerts by site impact" end test "displays empty state when no alerts", %{conn: conn, organization: _organization} do diff --git a/test/towerops_web/live/capacity_live_test.exs b/test/towerops_web/live/capacity_live_test.exs deleted file mode 100644 index 951003bc..00000000 --- a/test/towerops_web/live/capacity_live_test.exs +++ /dev/null @@ -1,97 +0,0 @@ -defmodule ToweropsWeb.CapacityLiveTest do - use ToweropsWeb.ConnCase, async: true - - import Phoenix.LiveViewTest - import Towerops.AccountsFixtures - - alias Towerops.Snmp.Device, as: SnmpDevice - alias Towerops.Snmp.Interface - alias Towerops.Snmp.InterfaceStat - - setup do - user = user_fixture(enable_totp: true) - {:ok, organization} = Towerops.Organizations.create_organization(%{name: "Test ISP"}, user.id) - - {:ok, site} = - Towerops.Sites.create_site(%{ - name: "Tower Alpha", - organization_id: organization.id - }) - - {:ok, device} = - Towerops.Devices.create_device(%{ - name: "Backhaul Radio", - ip_address: "10.0.0.1", - snmp_enabled: true, - snmp_version: "2c", - snmp_community: "public", - site_id: site.id, - organization_id: organization.id - }) - - snmp_device = - %SnmpDevice{} - |> SnmpDevice.changeset(%{device_id: device.id, sys_name: "radio", sys_descr: "PTP"}) - |> Towerops.Repo.insert!() - - interface = - %Interface{} - |> Interface.changeset(%{ - snmp_device_id: snmp_device.id, - if_index: 1, - if_name: "eth0", - if_speed: 1_000_000_000, - if_type: 6, - configured_capacity_bps: 300_000_000, - capacity_source: "manual" - }) - |> Towerops.Repo.insert!() - - now = DateTime.utc_now() - - %InterfaceStat{} - |> InterfaceStat.changeset(%{ - interface_id: interface.id, - if_in_octets: 0, - if_out_octets: 0, - checked_at: DateTime.add(now, -120, :second) - }) - |> Towerops.Repo.insert!() - - %InterfaceStat{} - |> InterfaceStat.changeset(%{ - interface_id: interface.id, - if_in_octets: 0, - if_out_octets: 1_125_000_000, - checked_at: DateTime.add(now, -60, :second) - }) - |> Towerops.Repo.insert!() - - %{user: user, organization: organization, site: site, device: device, interface: interface} - end - - describe "capacity index page" do - test "redirects to login when not authenticated", %{conn: conn} do - assert {:error, redirect} = live(conn, ~p"/capacity") - assert {:redirect, %{to: to}} = redirect - assert to =~ "/users/log-in" - end - - test "displays capacity page with site data", %{conn: conn, user: user} do - conn = log_in_user(conn, user) - {:ok, _view, html} = live(conn, ~p"/capacity") - - assert html =~ "Capacity" - assert html =~ "Tower Alpha" - assert html =~ "300.0 Mbps" - end - - test "shows utilization percentage for site", %{conn: conn, user: user} do - conn = log_in_user(conn, user) - {:ok, _view, html} = live(conn, ~p"/capacity") - - # Site has 300 Mbps capacity with ~150 Mbps throughput = ~50% - assert html =~ "%" - end - end -end