fix: remove stale tests for deleted capacity route and removed subtitle
- Delete capacity_live_test.exs — /capacity route was removed from router - Remove assertion for subtitle text that was removed from alerts page
This commit is contained in:
parent
6db0213686
commit
4246ffa7a0
2 changed files with 0 additions and 98 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
Loading…
Add table
Reference in a new issue