Closed ggcampinho closed 1 month ago
Phoenix.LiveViewTest.file_input/4 is ignoring the option last_modified, so it's impossible to populate entry.client_last_modified with this test function as the documentation says.
Phoenix.LiveViewTest.file_input/4
last_modified
entry.client_last_modified
[test/phoenix_live_view/upload/external_test.exs:233: Phoenix.LiveView.UploadExternalTest."test consume_uploaded_entries"/1] file_input(lv, "form", :avatar, [ %{name: "foo.jpeg", content: String.duplicate("ok", 100), last_modified: 1_594_171_879_000} ]) #=> #Phoenix.LiveViewTest.Upload< selector: nil, entries: [ %{ "content" => "okokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokok", "name" => "foo.jpeg", "ref" => "9417", "relative_path" => nil, "size" => 200, "type" => "image/jpeg" } ], ... > [test/phoenix_live_view/upload/external_test.exs:239: Phoenix.LiveView.UploadExternalTest."test consume_uploaded_entries"/1] entry #=> %Phoenix.LiveView.UploadEntry{ progress: 100, preflighted?: true, upload_config: :avatar, upload_ref: "phx-F9CfhwGDfrW4fgdD", ref: "1924", uuid: "d3bd3c54-cb47-4e41-a40a-6b4ecbf9e294", valid?: true, done?: true, cancelled?: false, client_name: "foo.jpeg", client_relative_path: nil, client_size: 200, client_type: "image/jpeg", client_last_modified: nil, client_meta: nil }
[test/phoenix_live_view/upload/external_test.exs:233: Phoenix.LiveView.UploadExternalTest."test consume_uploaded_entries"/1] file_input(lv, "form", :avatar, [ %{name: "foo.jpeg", content: String.duplicate("ok", 100), last_modified: 1_594_171_879_000} ]) #=> #Phoenix.LiveViewTest.Upload< selector: nil, entries: [ %{ "content" => "okokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokokok", "last_modified" => 1594171879000, "name" => "foo.jpeg", "ref" => "4354", "relative_path" => nil, "size" => 200, "type" => "image/jpeg" } ], ... > [test/phoenix_live_view/upload/external_test.exs:239: Phoenix.LiveView.UploadExternalTest."test consume_uploaded_entries"/1] entry #=> %Phoenix.LiveView.UploadEntry{ progress: 100, preflighted?: true, upload_config: :avatar, upload_ref: "phx-F9CffrMSpNMdjAdC", ref: "1923", uuid: "61511cac-9568-4e5d-8bed-ede46331ce4c", valid?: true, done?: true, cancelled?: false, client_name: "foo.jpeg", client_relative_path: nil, client_size: 200, client_type: "image/jpeg", client_last_modified: 1594171879000, client_meta: nil }
:green_heart: :blue_heart: :purple_heart: :yellow_heart: :heart:
Phoenix.LiveViewTest.file_input/4
is ignoring the optionlast_modified
, so it's impossible to populateentry.client_last_modified
with this test function as the documentation says.Before
After