Skip to content

Commit

Permalink
Add release channel creation testing
Browse files Browse the repository at this point in the history
  • Loading branch information
zacksiri committed Jun 19, 2024
1 parent 1497e32 commit 51339b4
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 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 @@ -44,5 +44,29 @@ defmodule PolarWeb.Dashboard.Credential.NewLiveTest do

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

test "create new credential with testing release channel", %{conn: conn, space: space} do
{:ok, lv, _html} = live(conn, ~p"/dashboard/spaces/#{space.id}/credentials/new")

lv
|> form("#new-credential-form", %{
"credential" => %{
"name" => "new-cred-test-testing",
"type" => "lxd",
"release_channel" => "testing",
"expires_in" => "2592000"
}
})
|> render_submit()

credential = Repo.get_by!(Space.Credential, name: "new-cred-test-testing")

assert credential.release_channel == "testing"

{:ok, lv, _html} =
live(conn, ~p"/dashboard/spaces/#{space.id}/credentials/#{credential.id}")

assert render(lv) =~ "testing"
end
end
end

0 comments on commit 51339b4

Please sign in to comment.