From 58176d5fa0e29100689610c46ff93f83a0862eda Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Tue, 3 Mar 2020 10:34:20 +0000 Subject: [PATCH] State when organisation has no live services The page looks broken otherwise. --- app/templates/views/organisations/organisation/index.html | 6 ++++++ tests/app/main/views/organisations/test_organisation.py | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/app/templates/views/organisations/organisation/index.html b/app/templates/views/organisations/organisation/index.html index fe0e57c85..9c766a612 100644 --- a/app/templates/views/organisations/organisation/index.html +++ b/app/templates/views/organisations/organisation/index.html @@ -106,5 +106,11 @@ {% endfor %}
+ {% if not services %} +

+ {{ current_org.name }} has no live services on GOV.UK Notify +

+
+ {% endif %} {% endblock %} diff --git a/tests/app/main/views/organisations/test_organisation.py b/tests/app/main/views/organisations/test_organisation.py index 06436e29a..1f3777e9d 100644 --- a/tests/app/main/views/organisations/test_organisation.py +++ b/tests/app/main/views/organisations/test_organisation.py @@ -74,6 +74,9 @@ def test_view_organisation_shows_the_correct_organisation( ) assert normalize_spaces(page.select_one('h1').text) == 'Usage' + assert normalize_spaces(page.select_one('.govuk-hint').text) == ( + 'Test 1 has no live services on GOV.UK Notify' + ) def test_page_to_create_new_organisation( @@ -435,6 +438,9 @@ def test_organisation_services_shows_live_services_and_usage( assert normalize_spaces(usage_rows[7].text) == "£42.00 spent on text messages" assert normalize_spaces(usage_rows[8].text) == "£0.00 spent on letters" + # Ensure there’s no ‘this org has no services message’ + assert not page.select('.govuk-hint') + @freeze_time("2020-02-20 20:20") @pytest.mark.parametrize('financial_year, expected_selected', (