livebook/test/livebook_web/live/explore_live_test.exs
Jonatan Kłosko f70581f255
Introduce an Explore section (#310)
* Add explore page

* Move sidebar to a configurable component

* Fix homepage test

* Add images

* Store example notebooks in files and make explore notebooks linkable

* Fix tests

* Raise on invalid notebook slug

* Keep just the file contents in notebook info

* Move notebook lookup to Explore

* Exclude notebooks in progress
2021-06-02 21:51:43 +02:00

19 lines
504 B
Elixir

defmodule LivebookWeb.ExploreLiveTest do
use LivebookWeb.ConnCase
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
end