From d0ef9135202ccfdae4f310b42dcc3d31b811b091 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Tue, 2 Aug 2016 10:34:27 +0100 Subject: [PATCH] Add a message if there are more than 50 rows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Similar to how we do it on the check page, we should indicate if there are more results than we can show. No-one’s really complained about the absence of this, but it can’t hurt. --- app/templates/partials/jobs/notifications.html | 6 ++++++ tests/app/main/views/test_jobs.py | 1 + tests/conftest.py | 6 ++++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/templates/partials/jobs/notifications.html b/app/templates/partials/jobs/notifications.html index 6ed2b61b3..f915e6a11 100644 --- a/app/templates/partials/jobs/notifications.html +++ b/app/templates/partials/jobs/notifications.html @@ -50,6 +50,12 @@ {% endcall %} {% endcall %} + {% if more_than_one_page %} + + {% endif %} + {% if notifications %} {% endif %} diff --git a/tests/app/main/views/test_jobs.py b/tests/app/main/views/test_jobs.py index d33c85511..c68a42068 100644 --- a/tests/app/main/views/test_jobs.py +++ b/tests/app/main/views/test_jobs.py @@ -95,6 +95,7 @@ def test_should_show_page_for_one_job( ) assert csv_link.text == 'Download this report' assert page.find('span', {'id': 'time-left'}).text == 'Data available for 7 days' + assert page.find('p', {'class': 'table-show-more-link'}).text.strip() == 'Only showing the first 50 rows' mock_get_notifications.assert_called_with( service_one['id'], fake_uuid, diff --git a/tests/conftest.py b/tests/conftest.py index 47fd6e1b7..1535d0080 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -910,14 +910,16 @@ def mock_get_notifications(mocker, api_user_active): template={'template_type': set_template_type, 'name': 'name', 'id': 'id', 'version': 1}, rows=rows, status=set_status, - job=job + job=job, + with_links=True ) else: return notification_json( service_id, rows=rows, status=set_status, - job=job + job=job, + with_links=True ) return mocker.patch(