mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-03-01 01:13:16 +08:00
Fix tests
This commit is contained in:
parent
826a3eb782
commit
e0f1442f5e
3 changed files with 13 additions and 1 deletions
|
@ -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 [
|
||||
%{
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue