diff --git a/test/livebook/hub/settings_test.exs b/test/livebook/hub/settings_test.exs index a587979c0..be42ac3d8 100644 --- a/test/livebook/hub/settings_test.exs +++ b/test/livebook/hub/settings_test.exs @@ -6,8 +6,12 @@ defmodule Livebook.Hub.SettingsTest do @machine_id Livebook.Utils.random_id() test "fetch_machines/0 returns a list of persisted machines" do + for %{id: machine_id} <- Livebook.Hub.Settings.fetch_machines() do + Livebook.Storage.current().delete(:hub, machine_id) + end + machine = %Machine{id: @machine_id, name: "Foo - bar", token: "foo", color: "#FF00FF"} - assert Settings.save_machine(machine) + Settings.save_machine(machine) assert [ %{ diff --git a/test/livebook_web/live/home_live_test.exs b/test/livebook_web/live/home_live_test.exs index b0e4b0132..becc5968a 100644 --- a/test/livebook_web/live/home_live_test.exs +++ b/test/livebook_web/live/home_live_test.exs @@ -235,6 +235,8 @@ defmodule LivebookWeb.HomeLiveTest do test "doesn't show with disabled feature flag", %{conn: conn} do Application.put_env(:livebook, :feature_flags, hub: false) {:ok, _view, html} = live(conn, "/") + Application.put_env(:livebook, :feature_flags, hub: true) + refute html =~ "HUBS" end @@ -257,6 +259,8 @@ defmodule LivebookWeb.HomeLiveTest do {:ok, _view, html} = live(conn, "/") assert html =~ "HUBS" assert html =~ "Foo - bar" + + Livebook.Storage.current().delete(:hub, machine.id) end end diff --git a/test/livebook_web/live/hub_live_test.exs b/test/livebook_web/live/hub_live_test.exs index a5f6c8c22..c3ed7e5c4 100644 --- a/test/livebook_web/live/hub_live_test.exs +++ b/test/livebook_web/live/hub_live_test.exs @@ -100,6 +100,10 @@ defmodule LivebookWeb.HubLiveTest do |> Floki.find(".sidebar--hub") |> Floki.find(".ml-1.text-sm.font-medium") |> Floki.text() =~ "My Foo Hub" + + for %{id: machine_id} <- Livebook.Hub.Settings.fetch_machines() do + Livebook.Storage.current().delete(:hub, machine_id) + end end end