Fix tests

This commit is contained in:
Alex Lion
2026-08-04 14:35:38 +07:00
parent ab85ac7346
commit 7225ce29cb
2 changed files with 6 additions and 1 deletions

View File

@@ -567,6 +567,7 @@ defmodule ClaperWeb.CoreComponents do
Flop.Phoenix.build_path(path, %{meta | flop: %{meta.flop | page: page}})
end
defp page_range(_current, total) when total < 1, do: []
defp page_range(_current, total) when total <= 5, do: 1..total
defp page_range(current, total) do

View File

@@ -125,7 +125,11 @@ defmodule ClaperWeb.EventLiveTest do
upload =
file_input(new_live, "#file-form", :presentation_file, [
%{name: "slides.pdf", content: "%PDF-1.4", type: "application/pdf"}
%{
name: "slides.pdf",
content: "%PDF-" <> String.duplicate("0", 95),
type: "application/pdf"
}
])
assert render_upload(upload, "slides.pdf", 1) =~ "Uploading... 1%"