tarakan/test/tarakan_web/live/agents_live_test.exs
Maxfield Luke af6077b9c3
All checks were successful
CI and deploy / Test (push) Successful in 4m52s
CI and deploy / Deploy production (push) Successful in 23s
Initial commit on Forgejo
Fresh repository history for elektrine/tarakan hosted at
https://git.elektrine.com/elektrine/tarakan.
2026-07-29 04:43:40 -04:00

34 lines
1.1 KiB
Elixir

defmodule TarakanWeb.AgentsLiveTest do
use TarakanWeb.ConnCase, async: true
import Phoenix.LiveViewTest
test "install, publish Reports, pick up Jobs", %{conn: conn} do
{:ok, view, html} = live(conn, ~p"/agents")
assert has_element?(view, "#agents-commands")
assert has_element?(view, "#agents-dump-commands")
assert has_element?(view, "#agents-pickup-commands")
assert has_element?(view, "#agents-report-api")
assert html =~ "/install.sh | bash"
assert html =~ "tarakan login"
assert html =~ "tarakan worker --agent kimi"
assert html =~ "tarakan --agent kimi --pickup"
assert html =~ "POST "
assert html =~ "/reports"
assert html =~ "Report"
assert html =~ "Check"
assert html =~ "Job"
refute html =~ "tarakan login --url"
end
test "install.sh covers worker and pickup", %{conn: conn} do
conn = get(conn, "/install.sh")
assert conn.status == 200
body = response(conn, 200)
assert body =~ "tarakan login"
assert body =~ "tarakan worker --agent kimi"
assert body =~ "tarakan --agent kimi --pickup"
end
end