Add test for selecting a write-protected file

This commit is contained in:
Jonatan Kłosko 2021-04-14 16:38:54 +02:00
parent 9e026ee4b9
commit 83b94c6b0b
2 changed files with 19 additions and 0 deletions

View file

@ -77,6 +77,24 @@ defmodule LivebookWeb.HomeLiveTest do
|> element(~s{button[phx-click="fork"][disabled]}, "Fork")
|> has_element?()
end
test "disables open when a write-protected notebook is selected", %{conn: conn} do
{:ok, view, _} = live(conn, "/")
path = test_notebook_path("write_protected")
view
|> element("form")
|> render_change(%{path: path})
assert view
|> element(~s{button[phx-click="open"][disabled]}, "Open")
|> has_element?()
assert view
|> element(~s{[aria-label="This file is write-protected, please fork instead"]})
|> has_element?()
end
end
describe "sessions list" do

View file

@ -0,0 +1 @@
# Write-protected notebook