mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-26 21:31:11 -05:00
Fix accidental switch of previous and next
We were showing the previous page link when we meant to show the next page link because the variables were swapped round in the code.
This commit is contained in:
@@ -46,10 +46,10 @@ def uploads(service_id):
|
||||
uploads = current_service.get_page_of_uploads(page=request.args.get('page'))
|
||||
|
||||
prev_page = None
|
||||
if uploads.next_page:
|
||||
if uploads.prev_page:
|
||||
prev_page = generate_previous_dict('main.uploads', service_id, uploads.current_page)
|
||||
next_page = None
|
||||
if uploads.prev_page:
|
||||
if uploads.next_page:
|
||||
next_page = generate_next_dict('main.uploads', service_id, uploads.current_page)
|
||||
|
||||
if uploads.current_page == 1:
|
||||
|
||||
@@ -660,3 +660,21 @@ def test_uploads_page_shows_scheduled_jobs(
|
||||
),
|
||||
]
|
||||
assert not page.select('.table-empty-message')
|
||||
|
||||
|
||||
def test_get_uploads_shows_pagination(
|
||||
client_request,
|
||||
active_user_with_permissions,
|
||||
mock_get_jobs,
|
||||
mock_get_uploads,
|
||||
):
|
||||
page = client_request.get('main.uploads', service_id=SERVICE_ONE_ID)
|
||||
|
||||
assert normalize_spaces(page.select_one('.next-page').text) == (
|
||||
'Next page '
|
||||
'page 2'
|
||||
)
|
||||
assert normalize_spaces(page.select_one('.previous-page').text) == (
|
||||
'Previous page '
|
||||
'page 0'
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user