mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-10-29 06:46:03 +08:00
Add test for selecting a write-protected file
This commit is contained in:
parent
9e026ee4b9
commit
83b94c6b0b
2 changed files with 19 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
1
test/support/notebooks/write_protected.livemd
Normal file
1
test/support/notebooks/write_protected.livemd
Normal file
|
|
@ -0,0 +1 @@
|
|||
# Write-protected notebook
|
||||
Loading…
Add table
Reference in a new issue