drop to 15 records per page

This commit is contained in:
James Greenwood
2025-11-17 14:37:33 +00:00
parent 50e9a9de3f
commit 2df603a074
4 changed files with 51 additions and 11 deletions

View File

@@ -75,14 +75,14 @@ defmodule ActionRequestsDemoWeb.ActionRequestsLiveTest do
test "pagination displays correct records per page", %{conn: conn} do
{:ok, view, _html} = live(conn, "/")
# Default ordering is inserted_at: :desc, so page 1 shows Patient 30..6
for i <- 30..6//-1 do
for i <- 30..16//-1 do
assert has_element?(view, "td", "Patient #{i}")
end
# Page 2 should show Patient 5..1
render_click(element(view, "a", "Next"))
for i <- 5..1//-1 do
for i <- 15..1//-1 do
assert has_element?(view, "td", "Patient #{i}")
end
end
@@ -167,17 +167,17 @@ defmodule ActionRequestsDemoWeb.ActionRequestsLiveTest do
test "pagination metadata displays correctly", %{conn: conn} do
{:ok, view, _html} = live(conn, "/")
# Page 1 of 2, showing 25 of 30 records
# Page 1 of 2, showing 15 of 30 records
assert has_element?(view, "div", "Page 1 of 2")
assert has_element?(view, "div", "showing 25 of 30 records")
assert has_element?(view, "div", "showing 15 of 30 records")
end
test "pagination metadata updates after navigating", %{conn: conn} do
{:ok, view, _html} = live(conn, "/")
render_click(element(view, "a", "Next"))
# Page 2 of 2, showing 5 of 30 records
# Page 2 of 2, showing 15 of 30 records
assert has_element?(view, "div", "Page 2 of 2")
assert has_element?(view, "div", "showing 5 of 30 records")
assert has_element?(view, "div", "showing 15 of 30 records")
end
test "pagination metadata updates with filters", %{conn: conn} do