mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-01-11 09:27:47 +08:00
28 lines
776 B
Elixir
28 lines
776 B
Elixir
defmodule LivebookWeb.ExploreLiveTest do
|
|
use LivebookWeb.ConnCase, async: true
|
|
|
|
import Phoenix.LiveViewTest
|
|
|
|
test "link to introductory notebook correctly creates a new session", %{conn: conn} do
|
|
{:ok, view, _} = live(conn, "/explore")
|
|
|
|
assert {:error, {:live_redirect, %{to: to}}} =
|
|
view
|
|
|> element(~s{#welcome-to-livebook a}, "Open notebook")
|
|
|> render_click()
|
|
|
|
assert to =~ "/sessions/"
|
|
|
|
{:ok, view, _} = live(conn, to)
|
|
assert render(view) =~ "Welcome to Livebook"
|
|
end
|
|
|
|
test "link to a new notebook creates an empty session", %{conn: conn} do
|
|
{:ok, view, _} =
|
|
conn
|
|
|> live("/explore/notebooks/new")
|
|
|> follow_redirect(conn)
|
|
|
|
assert render(view) =~ "Untitled notebook"
|
|
end
|
|
end
|