towerops/test/towerops_web/live/components/status_title_component_test.exs

28 lines
721 B
Elixir

defmodule ToweropsWeb.Live.Components.StatusTitleComponentTest do
use ExUnit.Case, async: true
import Phoenix.Component
import Phoenix.LiveViewTest
alias ToweropsWeb.Live.Components.StatusTitleComponent
describe "render/1" do
test "renders the status title watcher div" do
assigns = %{id: "status-title-watcher"}
html =
render_component(
fn _inner_assigns ->
~H"""
<.live_component module={StatusTitleComponent} id={@id} />
"""
end,
assigns
)
assert html =~ ~s(id="status-title-watcher")
assert html =~ ~s(phx-hook="StatusTitle")
assert html =~ ~s(style="display: none;")
end
end
end