livebook/test/livebook_web/live/explore_live_test.exs
Jonatan Kłosko 4d70e5cceb
Test and typing improvements (#949)
* Minimize race condition in the frame update test

* Use defmacrop for building intellisense context

* Remove unnecessary cell view computation

* Fix nested assets resolution

* Fix typing errors

* Add missing async attribute to test suites

* Improve rendering synchronization

* Up
2022-01-29 16:39:41 +01:00

28 lines
750 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{a}, "Let's go")
|> 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