Skip to content

Commit

Permalink
Bolster test
Browse files Browse the repository at this point in the history
  • Loading branch information
nshoes committed Jan 6, 2025
1 parent 2d2e038 commit 589e7ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/nerves_hub_web/live/devices/show.ex
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ defmodule NervesHubWeb.Live.Devices.Show do
socket
|> assign(:device, device)
|> assign(:deployment, nil)
|> assign(:eligible_deployments, Deployments.matching_deployments(device))
|> put_flash(:info, "Device successfully removed from the deployment")
|> noreply()
end
Expand Down
7 changes: 5 additions & 2 deletions test/nerves_hub_web/live/devices/show_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ defmodule NervesHubWeb.Live.Devices.ShowTest do
end

describe "clearing deployment" do
test "clears deployment", %{
test "clears deployment and eligible deployments list is refreshed", %{
conn: conn,
org: org,
product: product,
Expand All @@ -436,7 +436,10 @@ defmodule NervesHubWeb.Live.Devices.ShowTest do

conn
|> visit("/org/#{org.name}/#{product.name}/devices/#{device.identifier}")
|> click_button("Remove From Deployment")
|> unwrap(fn view ->
render_change(view, "remove-from-deployment")
end)
|> assert_has("div", text: "Eligible Deployments")

refute Repo.reload(device) |> Map.get(:deployment_id)
end
Expand Down

0 comments on commit 589e7ea

Please sign in to comment.