Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump phoenix_test from 0.3.1 to 0.4.2 #1601

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ test/fixtures/ssl/device-root-ca.srl

.env*
.iex.exs

.DS_Store
1 change: 1 addition & 0 deletions lib/nerves_hub_web/live/deployments/new.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
</.form>
<% else %>
<.form :let={f} for={@form} phx-submit="create-deployment">
<%!-- <%= hidden_input(f, :platform, value: @platform) %> --%>
<div class="form-group">
<label for="name_input">Deployment name</label>
<%= text_input(f, :name, class: "form-control", id: "name_input") %>
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ defmodule NervesHub.MixProject do
{:phoenix_pubsub, "~> 2.0"},
{:phoenix_swoosh, "~> 1.0"},
{:phoenix_view, "~> 2.0"},
{:phoenix_test, "~> 0.3.0", only: :test, runtime: false},
{:phoenix_test, "~> 0.4.2", only: :test, runtime: false},
{:plug, "~> 1.7"},
{:postgrex, "~> 0.14"},
{:scrivener_ecto, "~> 3.0"},
Expand Down
2 changes: 1 addition & 1 deletion mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"phoenix_pubsub": {:hex, :phoenix_pubsub, "2.1.3", "3168d78ba41835aecad272d5e8cd51aa87a7ac9eb836eabc42f6e57538e3731d", [:mix], [], "hexpm", "bba06bc1dcfd8cb086759f0edc94a8ba2bc8896d5331a1e2c2902bf8e36ee502"},
"phoenix_swoosh": {:hex, :phoenix_swoosh, "1.2.1", "b74ccaa8046fbc388a62134360ee7d9742d5a8ae74063f34eb050279de7a99e1", [:mix], [{:finch, "~> 0.8", [hex: :finch, repo: "hexpm", optional: true]}, {:hackney, "~> 1.10", [hex: :hackney, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6", [hex: :phoenix, repo: "hexpm", optional: true]}, {:phoenix_html, "~> 3.0 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_view, "~> 1.0 or ~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: false]}, {:swoosh, "~> 1.5", [hex: :swoosh, repo: "hexpm", optional: false]}], "hexpm", "4000eeba3f9d7d1a6bf56d2bd56733d5cadf41a7f0d8ffe5bb67e7d667e204a2"},
"phoenix_template": {:hex, :phoenix_template, "1.0.4", "e2092c132f3b5e5b2d49c96695342eb36d0ed514c5b252a77048d5969330d639", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}], "hexpm", "2c0c81f0e5c6753faf5cca2f229c9709919aba34fab866d3bc05060c9c444206"},
"phoenix_test": {:hex, :phoenix_test, "0.3.1", "adf5d67cb152fa1e0220527a9827db7f865a20817c7c0161315ba6fe86a8946c", [:mix], [{:deep_merge, "~> 1.0", [hex: :deep_merge, repo: "hexpm", optional: false]}, {:floki, ">= 0.30.0", [hex: :floki, repo: "hexpm", optional: false]}, {:jason, "~> 1.4", [hex: :jason, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.7.10", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_live_view, "~> 0.20.1", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}], "hexpm", "03f24332a966673ff40d35c45f427c7671537ea508b5777141dd60e60cdae22a"},
"phoenix_test": {:hex, :phoenix_test, "0.4.2", "bc00efd2bf736bc23bc40dbfd841aab88f14f767addb40b884d7910241e521b5", [:mix], [{:floki, ">= 0.30.0", [hex: :floki, repo: "hexpm", optional: false]}, {:jason, "~> 1.4", [hex: :jason, repo: "hexpm", optional: false]}, {:mime, ">= 1.0.0", [hex: :mime, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.7.10", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_live_view, "~> 0.20.1", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}], "hexpm", "22a1fab760aefb60f214c0796999bf167962583dd313fb595502500041668b5c"},
"phoenix_view": {:hex, :phoenix_view, "2.0.4", "b45c9d9cf15b3a1af5fb555c674b525391b6a1fe975f040fb4d913397b31abf4", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}], "hexpm", "4e992022ce14f31fe57335db27a28154afcc94e9983266835bb3040243eb620b"},
"plug": {:hex, :plug, "1.16.1", "40c74619c12f82736d2214557dedec2e9762029b2438d6d175c5074c933edc9d", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "a13ff6b9006b03d7e33874945b2755253841b238c34071ed85b0e86057f8cddc"},
"plug_crypto": {:hex, :plug_crypto, "2.1.0", "f44309c2b06d249c27c8d3f65cfe08158ade08418cf540fd4f72d4d6863abb7b", [:mix], [], "hexpm", "131216a4b030b8f8ce0f26038bc4421ae60e4bb95c5cf5395e1421437824c4fa"},
Expand Down
5 changes: 4 additions & 1 deletion test/nerves_hub_web/live/deployments/new_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
alias NervesHub.Fixtures

describe "new deployment" do
test "the happy path, with an audit log", %{

Check failure on line 9 in test/nerves_hub_web/live/deployments/new_test.exs

View workflow job for this annotation

GitHub Actions / compile-and-test

test new deployment the happy path, with an audit log (NervesHubWeb.Live.Deployments.NewTest)
conn: conn,
user: user,
org: org,
Expand All @@ -25,7 +25,10 @@
|> select(firmware.platform, from: "Platform")
|> fill_in("Deployment name", with: "Moussaka")
|> fill_in("Tag(s) distributed to", with: "josh, lars")
|> fill_in("Firmware version", with: firmware.id)
|> select(
"#{firmware.version} #{firmware.platform} #{firmware.architecture} #{firmware.uuid}",
from: "Firmware version"
)
|> click_button("Create Deployment")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joshk looking for some direction here before I venture out of this repo for answers. The change I made from fill_in -> select works, but now this test fails on submit:

 1) test new deployment the happy path, with an audit log (NervesHubWeb.Live.Deployments.NewTest)
     test/nerves_hub_web/live/deployments/new_test.exs:9
     ** (ArgumentError) could not find non-disabled input, select or textarea with name "deployment[platform]" within:

         <input class="form-control" id="name_input" name="deployment[name]" type="text"/>
         <input class="form-control" id="tags_input" name="deployment[tags]" type="text" value=""/>
         <select class="form-control" id="firmware_id" name="deployment[firmware_id]" required="required"><option value="">Choose a firmware version</option><option value="1564">1.0.0 taramasalata x86_64 8dc5f02a-298f-5890-bbda-b697d1b88d47</option></select>
         <input class="form-control" id="version_input" name="deployment[version]" type="text" value=""/>

     code: |> click_button("Create Deployment")
     stacktrace:
       (phoenix_live_view 0.20.17) lib/phoenix_live_view/test/live_view_test.ex:1102: Phoenix.LiveViewTest.call/2
       (phoenix_test 0.4.0) lib/phoenix_test/live.ex:328: PhoenixTest.Live.submit_form/4
       test/nerves_hub_web/live/deployments/new_test.exs:32: (test)

Phoenix.LiveViewTest is looking for deployment[platform], but the form element no longer exists because of the logic in deployments/new.html.eex.

Have you seen anything like this before? I have experience with LiveView, but not testing it with phoenix_test. I did verify this broke in 0.4.0 of phoenix_test.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can leave this with me as I was in talks with German (the author of the lib) about the issues I saw with upgrading; I just put this to the side temporarily as I picked up other items.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Thank you 🙇

|> assert_path(URI.encode("/org/#{org.name}/#{product.name}/deployments"))
|> assert_has("h1", text: "Deployments")
Expand Down
Loading