defmodule AshAdmin.Test.PageLiveTest do use ExUnit.Case, async: false import Plug.Conn import Phoenix.ConnTest import Phoenix.LiveViewTest @endpoint AshAdmin.Test.Endpoint setup do %{conn: build_conn()} end test "it renders the schema by default", %{conn: conn} do {:ok, _view, html} = live(conn, "/api/admin") assert html =~ "Attributes" assert html =~ "body" assert html =~ "String" {:ok, _view, html} = live(conn, "/api/admin/test") assert html =~ "Attributes" assert html =~ "body" assert html =~ "String" end test "embeds default csp nonces" do html = build_conn() |> get("/api/admin") |> html_response(200) assert html =~ "ash_admin-Ed55GFnX" assert html =~ ~s|