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

chore(deps): Bump phoenix_live_view from 0.20.3 to 0.20.11 #172

Merged
merged 2 commits into from
Mar 4, 2024
Merged
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: 1 addition & 1 deletion mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"phoenix_ecto": {:hex, :phoenix_ecto, "4.5.0", "1a1f841ccda19b15f1d82968840a5b895c5f687b6734e430e4b2dbe035ca1837", [:mix], [{:ecto, "~> 3.5", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14.2 or ~> 3.0 or ~> 4.1", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "13990570fde09e16959ef214501fe2813e1192d62ca753ec8798980580436f94"},
"phoenix_html": {:hex, :phoenix_html, "4.1.1", "4c064fd3873d12ebb1388425a8f2a19348cef56e7289e1998e2d2fa758aa982e", [:mix], [], "hexpm", "f2f2df5a72bc9a2f510b21497fd7d2b86d932ec0598f0210fed4114adc546c6f"},
"phoenix_live_reload": {:hex, :phoenix_live_reload, "1.5.0", "4d9aec15bdf0c83ca12818f363e02be86520846c15816684176d84c9c4de062e", [:mix], [{:file_system, "~> 0.3 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm", "577ba22de3213921d429dfb0cc6e2df426c28ffec6acb79746a2bc822bda39d9"},
"phoenix_live_view": {:hex, :phoenix_live_view, "0.20.3", "8b6406bc0a451f295407d7acff7f234a6314be5bbe0b3f90ed82b07f50049878", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6.15 or ~> 1.7.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.3 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.15", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "a8e4385e05618b424779f894ed2df97d3c7518b7285fcd11979077ae6226466b"},
"phoenix_live_view": {:hex, :phoenix_live_view, "0.20.11", "63975ad42e09f21ad0db53e6ee449804c844995019d133fee275900f29e4a099", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6.15 or ~> 1.7.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.3 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.15", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "56eb5a75e0981ce362b0daf50a6c1a6385863a767db3ae06ae17461458da0bc8"},
"phoenix_pubsub": {:hex, :phoenix_pubsub, "2.1.3", "3168d78ba41835aecad272d5e8cd51aa87a7ac9eb836eabc42f6e57538e3731d", [:mix], [], "hexpm", "bba06bc1dcfd8cb086759f0edc94a8ba2bc8896d5331a1e2c2902bf8e36ee502"},
"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"},
"plug": {:hex, :plug, "1.15.3", "712976f504418f6dff0a3e554c40d705a9bcf89a7ccef92fc6a5ef8f16a30a97", [: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", "cc4365a3c010a56af402e0809208873d113e9c38c401cabd88027ef4f5c01fd2"},
Expand Down
Binary file added priv/static/images/10mb.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 13 additions & 13 deletions test/app_web/live/imgup_live_test.exs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
defmodule AppWeb.ImgupLiveTest do
use AppWeb.ConnCase
import Phoenix.LiveViewTest
import AppWeb.UploadSupport

test "connected mount", %{conn: conn} do
conn = get(conn, "/liveview")
Expand Down Expand Up @@ -38,19 +39,20 @@ defmodule AppWeb.ImgupLiveTest do

test "file input errors - file too large", %{conn: conn} do
# Connect to LiveView
{:ok, live_view, _html} = live(conn, ~p"/liveview")
{:ok, lv, _html} = live(conn, ~p"/liveview")

# Build the upload input
upload =
file_input(live_view, "#upload-form", :image_list, [
%{name: "photo.png", content: "ok", size: 20_000_000}
])
# Get file and add it to the form
file =
[:code.priv_dir(:app), "static", "images", "10mb.jpeg"]
|> Path.join()
|> build_upload("image/jpeg")

# Render the form change from the input
view = live_view |> form("#upload-form") |> render_change(upload)
image = file_input(lv, "#upload-form", :image_list, [file])

# Assert there's a File Too Large error
assert view =~ "Too large."
{code, [[_, description]]} = render_upload(image, file.name)

assert code == :error
assert description == :too_large
end

test "file input errors - unnaceptable file type", %{conn: conn} do
Expand All @@ -60,7 +62,7 @@ defmodule AppWeb.ImgupLiveTest do
# Build the upload input
upload =
file_input(live_view, "#upload-form", :image_list, [
%{name: "photo.pdf", content: "ok", size: 100_000}
%{name: "photo.pdf", content: "ok"}
])

# Render the form change from the input
Expand All @@ -70,8 +72,6 @@ defmodule AppWeb.ImgupLiveTest do
assert view =~ "You have selected an unacceptable file type."
end

import AppWeb.UploadSupport

test "uploading a file", %{conn: conn} do
{:ok, lv, html} = live(conn, ~p"/liveview")
assert html =~ "Image Upload"
Expand Down
Loading