Start making it more robust

- Use structured data for search/render
- Start testing component
- Start testing domain logic
This commit is contained in:
Claudio Ortolina
2025-02-14 07:40:57 +00:00
parent 949fdb7138
commit d077f08afa
10 changed files with 801 additions and 20 deletions
@@ -326,4 +326,22 @@ defmodule MusicLibraryWeb.CollectionLive.IndexTest do
assert_path(session, ~p"/collection/#{record.id}")
end
end
describe "Add via barcode scan" do
test "it tracks the camera status", %{conn: conn} do
session =
conn
|> visit(~p"/collection/scan")
|> assert_has("h1", text: "Scan one or more barcodes")
|> assert_has("p", text: "pending")
session
|> unwrap(fn view ->
view
|> element("#barcode-scanner")
|> render_hook("camera_denied")
end)
|> assert_has("p", text: "denied")
end
end
end