From e3b1813ed7e9f5753c8c1df40a553d99e1ebfa9f Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Fri, 3 Jan 2020 14:14:38 +0000 Subject: [PATCH] Add a test for the no notifications message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This wasn’t tested before. --- tests/app/main/views/test_jobs.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/tests/app/main/views/test_jobs.py b/tests/app/main/views/test_jobs.py index 2b3e8f707..477794706 100644 --- a/tests/app/main/views/test_jobs.py +++ b/tests/app/main/views/test_jobs.py @@ -294,7 +294,27 @@ def test_should_show_job_in_progress( service_id=service_one['id'], job_id=fake_uuid, ) - assert page.find('p', {'class': 'hint'}).text.strip() == 'Report is 50% complete…' + assert page.select_one('p.hint').text.strip() == 'Report is 50% complete…' + + +def test_should_show_job_without_notifications( + client_request, + service_one, + active_user_with_permissions, + mock_get_service_template, + mock_get_job_in_progress, + mocker, + mock_get_notifications_with_no_notifications, + mock_get_service_data_retention, + fake_uuid, +): + page = client_request.get( + 'main.view_job', + service_id=service_one['id'], + job_id=fake_uuid, + ) + assert page.select_one('p.hint').text.strip() == 'Report is 50% complete…' + assert page.select_one('tbody').text.strip() == 'No messages to show' @freeze_time("2016-01-01 11:09:00.061258")