From 607c220bf2809dce67005ed6f7f4aff2dada85ee Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 22 May 2020 16:00:06 +0000 Subject: [PATCH] Bump phoenix_live_view from 0.12.1 to 0.13.0 (#742) --- mix.lock | 2 +- .../live/car_index_live_test.exs | 12 +++++-- .../live/car_summary_live_test.exs | 36 ++++++++++++++----- .../live/charge_cost_live_test.exs | 10 +++--- .../teslamate_web/live/geofence_live_test.exs | 24 ++++++------- test/teslamate_web/live/sign_in_test.exs | 5 ++- 6 files changed, 59 insertions(+), 30 deletions(-) diff --git a/mix.lock b/mix.lock index 9b68b447..24d72abb 100644 --- a/mix.lock +++ b/mix.lock @@ -38,7 +38,7 @@ "phoenix_ecto": {:hex, :phoenix_ecto, "4.1.0", "a044d0756d0464c5a541b4a0bf4bcaf89bffcaf92468862408290682c73ae50d", [:mix], [{:ecto, "~> 3.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.9", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "c5e666a341ff104d0399d8f0e4ff094559b2fde13a5985d4cb5023b2c2ac558b"}, "phoenix_html": {:hex, :phoenix_html, "2.14.2", "b8a3899a72050f3f48a36430da507dd99caf0ac2d06c77529b1646964f3d563e", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "58061c8dfd25da5df1ea0ca47c972f161beb6c875cd293917045b92ffe1bf617"}, "phoenix_live_reload": {:hex, :phoenix_live_reload, "1.2.2", "38d94c30df5e2ef11000697a4fbe2b38d0fbf79239d492ff1be87bbc33bc3a84", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm", "a3dec3d28ddb5476c96a7c8a38ea8437923408bc88da43e5c45d97037b396280"}, - "phoenix_live_view": {:hex, :phoenix_live_view, "0.12.1", "42f591c781edbf9fab921319076b7ac635d43aa23e6748d2644563326236d7e4", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.4.16 or ~> 1.5.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14", [hex: :phoenix_html, repo: "hexpm", optional: false]}], "hexpm", "585321e98df1cd5943e370b9784e950a37ca073744eb534660c9048967c52ab6"}, + "phoenix_live_view": {:hex, :phoenix_live_view, "0.13.0", "dec006b3da4ab164283d5bebe960724eb4d19cd0ed553e05fb99b260233e200f", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.4.17 or ~> 1.5.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14", [hex: :phoenix_html, repo: "hexpm", optional: false]}], "hexpm", "bd6f13b666fa9bfeca88b013db20414c693d5a5e6d19b1fc2602c282d626ed8e"}, "phoenix_pubsub": {:hex, :phoenix_pubsub, "2.0.0", "a1ae76717bb168cdeb10ec9d92d1480fec99e3080f011402c0a2d68d47395ffb", [:mix], [], "hexpm", "c52d948c4f261577b9c6fa804be91884b381a7f8f18450c5045975435350f771"}, "plug": {:hex, :plug, "1.10.1", "c56a6d9da7042d581159bcbaef873ba9d87f15dce85420b0d287bca19f40f9bd", [], [{:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm", "b5cd52259817eb8a31f2454912ba1cff4990bca7811918878091cb2ab9e52cb8"}, "plug_cowboy": {:hex, :plug_cowboy, "2.2.1", "fcf58aa33227a4322a050e4783ee99c63c031a2e7f9a2eb7340d55505e17f30f", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "3b43de24460d87c0971887286e7a20d40462e48eb7235954681a20cee25ddeb6"}, diff --git a/test/teslamate_web/live/car_index_live_test.exs b/test/teslamate_web/live/car_index_live_test.exs index c2663358..bf05271a 100644 --- a/test/teslamate_web/live/car_index_live_test.exs +++ b/test/teslamate_web/live/car_index_live_test.exs @@ -14,7 +14,9 @@ defmodule TeslaMateWeb.CarLive.Indextest do assert %GlobalSettings{base_url: nil} = Settings.get_global_settings!() assert {:ok, _parent_view, _html} = - live(conn, "/", connect_params: %{"baseUrl" => "http://example.com "}) + conn + |> put_connect_params(%{"baseUrl" => "http://example.com "}) + |> live("/") assert %GlobalSettings{base_url: "http://example.com"} = Settings.get_global_settings!() end @@ -28,7 +30,9 @@ defmodule TeslaMateWeb.CarLive.Indextest do |> Settings.update_global_settings(%{base_url: "https://example.com"}) assert {:ok, _parent_view, _html} = - live(conn, "/", connect_params: %{"baseUrl" => "http://foo.bar/ "}) + conn + |> put_connect_params(%{"baseUrl" => "http://foo.bar/ "}) + |> live("/") assert %GlobalSettings{base_url: "https://example.com"} = Settings.get_global_settings!() end @@ -40,7 +44,9 @@ defmodule TeslaMateWeb.CarLive.Indextest do for base_url <- [nil, "udp://10.0.0.1", "", "example.com"] do assert {:ok, _parent_view, _html} = - live(conn, "/", connect_params: %{"baseUrl" => base_url}) + conn + |> put_connect_params(%{"baseUrl" => base_url}) + |> live("/") end assert %GlobalSettings{base_url: nil} = Settings.get_global_settings!() diff --git a/test/teslamate_web/live/car_summary_live_test.exs b/test/teslamate_web/live/car_summary_live_test.exs index 7fbc4da8..b426f240 100644 --- a/test/teslamate_web/live/car_summary_live_test.exs +++ b/test/teslamate_web/live/car_summary_live_test.exs @@ -65,7 +65,9 @@ defmodule TeslaMateWeb.CarLive.SummaryTest do :ok = start_vehicles(events) assert {:ok, parent_view, _html} = - live(conn, "/", connect_params: %{"baseUrl" => "http://localhost"}) + conn + |> put_connect_params(%{"baseUrl" => "http://localhost"}) + |> live("/") [view] = live_children(parent_view) html = render(view) @@ -143,7 +145,9 @@ defmodule TeslaMateWeb.CarLive.SummaryTest do :ok = start_vehicles(events) assert {:ok, parent_view, html} = - live(conn, "/", connect_params: %{"baseUrl" => "http://localhost"}) + conn + |> put_connect_params(%{"baseUrl" => "http://localhost"}) + |> live("/") [view] = live_children(parent_view) render_click(view, :suspend_logging) @@ -184,7 +188,9 @@ defmodule TeslaMateWeb.CarLive.SummaryTest do :ok = start_vehicles(events) assert {:ok, parent_view, html} = - live(conn, "/", connect_params: %{"baseUrl" => "http://localhost"}) + conn + |> put_connect_params(%{"baseUrl" => "http://localhost"}) + |> live("/") assert table_row(html, "Status", "online") @@ -240,7 +246,9 @@ defmodule TeslaMateWeb.CarLive.SummaryTest do Process.sleep(300) assert {:ok, _parent_view, html} = - live(conn, "/", connect_params: %{"baseUrl" => "http://localhost"}) + conn + |> put_connect_params(%{"baseUrl" => "http://localhost"}) + |> live("/") assert {"span", _, [{"span", [{"class", "mdi mdi-alert-box"}], _}]} = html @@ -266,7 +274,9 @@ defmodule TeslaMateWeb.CarLive.SummaryTest do :ok = start_vehicles(events) assert {:ok, _view, html} = - live(conn, "/", connect_params: %{"baseUrl" => "http://localhost"}) + conn + |> put_connect_params(%{"baseUrl" => "http://localhost"}) + |> live("/") assert [ {"span", @@ -294,7 +304,9 @@ defmodule TeslaMateWeb.CarLive.SummaryTest do :ok = start_vehicles(events) assert {:ok, view, _html} = - live(conn, "/", connect_params: %{"baseUrl" => "http://localhost"}) + conn + |> put_connect_params(%{"baseUrl" => "http://localhost"}) + |> live("/") TestHelper.eventually( fn -> @@ -331,7 +343,9 @@ defmodule TeslaMateWeb.CarLive.SummaryTest do :ok = start_vehicles(events) assert {:ok, view, _html} = - live(conn, "/", connect_params: %{"baseUrl" => "http://localhost"}) + conn + |> put_connect_params(%{"baseUrl" => "http://localhost"}) + |> live("/") TestHelper.eventually( fn -> @@ -366,7 +380,9 @@ defmodule TeslaMateWeb.CarLive.SummaryTest do Process.sleep(300) assert {:ok, _parent_view, html} = - live(conn, "/", connect_params: %{"baseUrl" => "http://localhost"}) + conn + |> put_connect_params(%{"baseUrl" => "http://localhost"}) + |> live("/") assert {"span", _, [{"span", [{"class", "mdi mdi-gift-outline"}], _}]} = html @@ -391,7 +407,9 @@ defmodule TeslaMateWeb.CarLive.SummaryTest do Process.sleep(300) assert {:ok, _parent_view, html} = - live(conn, "/", connect_params: %{"baseUrl" => "http://localhost"}) + conn + |> put_connect_params(%{"baseUrl" => "http://localhost"}) + |> live("/") assert {"span", _, [{"span", [{"class", "mdi mdi-snowflake"}], _}]} = html diff --git a/test/teslamate_web/live/charge_cost_live_test.exs b/test/teslamate_web/live/charge_cost_live_test.exs index c507aea1..8013826b 100644 --- a/test/teslamate_web/live/charge_cost_live_test.exs +++ b/test/teslamate_web/live/charge_cost_live_test.exs @@ -240,9 +240,9 @@ defmodule TeslaMateWeb.ChargeLive.CostTest do %ChargingProcess{id: id} = charging_process_fixture(car_fixture()) assert {:ok, _view, html} = - live(conn, "/charge-cost/#{id}", - connect_params: %{"referrer" => "http://grafana.example.com/d/xyz/12"} - ) + conn + |> put_connect_params(%{"referrer" => "http://grafana.example.com/d/xyz/12"}) + |> live("/charge-cost/#{id}") assert ["http://grafana.example.com/d/xyz/12"] = html @@ -255,7 +255,9 @@ defmodule TeslaMateWeb.ChargeLive.CostTest do %ChargingProcess{id: id} = charging_process_fixture(car_fixture()) assert {:ok, _view, html} = - live(conn, "/charge-cost/#{id}", connect_params: %{"referrer" => nil}) + conn + |> put_connect_params(%{"referrer" => nil}) + |> live("/charge-cost/#{id}") assert ["/"] = html diff --git a/test/teslamate_web/live/geofence_live_test.exs b/test/teslamate_web/live/geofence_live_test.exs index 511d0ecc..55b5b964 100644 --- a/test/teslamate_web/live/geofence_live_test.exs +++ b/test/teslamate_web/live/geofence_live_test.exs @@ -360,9 +360,9 @@ defmodule TeslaMateWeb.GeoFenceLiveTest do assert %GlobalSettings{grafana_url: nil} = Settings.get_global_settings!() assert {:ok, _parent_view, _html} = - live(conn, "/geo-fences/new?lat=0.0&lng=0.0", - connect_params: %{"referrer" => "http://grafana.example.com/d/xyz/12"} - ) + conn + |> put_connect_params(%{"referrer" => "http://grafana.example.com/d/xyz/12"}) + |> live("/geo-fences/new?lat=0.0&lng=0.0") assert %GlobalSettings{grafana_url: "http://grafana.example.com"} = Settings.get_global_settings!() @@ -373,9 +373,9 @@ defmodule TeslaMateWeb.GeoFenceLiveTest do for referrer <- [nil, "", "example.com", "http://example.com", "http://example.com/"] do assert {:ok, _parent_view, _html} = - live(conn, "/geo-fences/new?lat=0.0&lng=0.0", - connect_params: %{"referrer" => referrer} - ) + conn + |> put_connect_params(%{"referrer" => referrer}) + |> live("/geo-fences/new?lat=0.0&lng=0.0") assert %GlobalSettings{grafana_url: nil} = Settings.get_global_settings!() end @@ -385,9 +385,9 @@ defmodule TeslaMateWeb.GeoFenceLiveTest do assert %GlobalSettings{grafana_url: nil} = Settings.get_global_settings!() assert {:ok, _parent_view, _html} = - live(conn, "/geo-fences/new?lat=0.0&lng=0.0", - connect_params: %{"referrer" => "http://example.com:9090/grafana/d/xyz/12"} - ) + conn + |> put_connect_params(%{"referrer" => "http://example.com:9090/grafana/d/xyz/12"}) + |> live("/geo-fences/new?lat=0.0&lng=0.0") assert %GlobalSettings{grafana_url: "http://example.com:9090/grafana"} = Settings.get_global_settings!() @@ -399,9 +399,9 @@ defmodule TeslaMateWeb.GeoFenceLiveTest do |> Settings.update_global_settings(%{grafana_url: "https://grafana.example.com"}) assert {:ok, _parent_view, _html} = - live(conn, "/geo-fences/new?lat=0.0&lng=0.0", - connect_params: %{"referrer" => "http://grafana.foo.com/d/xyz/12"} - ) + conn + |> put_connect_params(%{"referrer" => "http://grafana.foo.com/d/xyz/12"}) + |> live("/geo-fences/new?lat=0.0&lng=0.0") assert %GlobalSettings{grafana_url: "https://grafana.example.com"} = Settings.get_global_settings!() diff --git a/test/teslamate_web/live/sign_in_test.exs b/test/teslamate_web/live/sign_in_test.exs index d0ea5df8..a76f4944 100644 --- a/test/teslamate_web/live/sign_in_test.exs +++ b/test/teslamate_web/live/sign_in_test.exs @@ -33,7 +33,10 @@ defmodule TeslaMateWeb.SignInLiveTest do test "signs in", %{conn: conn, test: name} do params = start_api(name) - assert {:ok, view, _html} = live(conn, "/sign_in", connect_params: params) + assert {:ok, view, _html} = + conn + |> put_connect_params(params) + |> live("/sign_in") render_change(view, :validate, %{ credentials: %{email: "$email", password: "$password"}