Skip to content

Commit

Permalink
Add test for field validation
Browse files Browse the repository at this point in the history
  • Loading branch information
zacksiri committed Feb 27, 2024
1 parent 4bb0bca commit 62921c6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/polar_web/live/dashboard/credential/new_live_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,17 @@ defmodule PolarWeb.Dashboard.Credential.NewLiveTest do

assert_redirect(lv, ~p"/dashboard/spaces/#{space.id}/credentials/#{credential.id}")
end

test "validation", %{conn: conn, space: space} do
{:ok, lv, _html} = live(conn, ~p"/dashboard/spaces/#{space.id}/credentials/new")

lv
|> form("#new-credential-form")
|> render_change(%{
"credential" => %{"name" => "new-cred-test"}
})

assert render(lv) =~ "can't be blank"
end
end
end

0 comments on commit 62921c6

Please sign in to comment.