UX: paginate booking operations
This commit is contained in:
@@ -6,6 +6,20 @@ def test_list_bookings_filters_by_vehicle(ops_client):
|
||||
assert all(b["vehicle_ref"] == "MO-024" for b in bookings)
|
||||
|
||||
|
||||
def test_list_bookings_supports_bounded_search_pages(ops_client):
|
||||
response = ops_client.get(
|
||||
"/api/v1/bookings",
|
||||
params={"query": "BK-", "page": 1, "page_size": 25},
|
||||
)
|
||||
assert response.status_code == 200
|
||||
body = response.json()
|
||||
assert body["page"] == 1
|
||||
assert body["page_size"] == 25
|
||||
assert body["total"] > 25
|
||||
assert body["total_pages"] > 1
|
||||
assert len(body["items"]) == 25
|
||||
|
||||
|
||||
def test_get_booking_detail(ops_client):
|
||||
response = ops_client.get("/api/v1/bookings/BK-DEMO-RETURN")
|
||||
assert response.status_code == 200
|
||||
|
||||
Reference in New Issue
Block a user