From 4eb886d8c026d780bc8dd241fe256b694bdbfe5d Mon Sep 17 00:00:00 2001 From: Beverly Nguyen Date: Tue, 13 Feb 2024 18:18:13 -0800 Subject: [PATCH] update test --- .../views/notifications/notification.html | 28 ++++++++----------- tests/app/main/views/test_notifications.py | 18 ++++-------- 2 files changed, 17 insertions(+), 29 deletions(-) diff --git a/app/templates/views/notifications/notification.html b/app/templates/views/notifications/notification.html index 9c921729d..5a03daf3d 100644 --- a/app/templates/views/notifications/notification.html +++ b/app/templates/views/notifications/notification.html @@ -20,26 +20,20 @@ {{ page_header( 1|message_count_label(template.template_type, suffix='') | capitalize ) }} -

- {% if help %} - ‘{{ template.name }}’ - {% else %} - - {% endif %} -

-
-

{{ template.name }} - {{ current_service.name }}

-

- Was sent on {{ created_at|format_datetime_short_12h }} by {{ created_by.name }} -

-
+ {% if help %} +

‘{{ template.name }}’

+ {% endif %} +
+
+

{{ template.name }} - {{ current_service.name }}

+

+ Was sent on {{ created_at|format_datetime_short_12h }} by {{ created_by.name }} +

-

- -
- {{ template|string }}
+ {{ template|string }} + {% if template.template_type == 'email' %}
{{ ajax_block(partials, updates_url, 'status', finished=finished) }} diff --git a/tests/app/main/views/test_notifications.py b/tests/app/main/views/test_notifications.py index 61a7f495d..ce7bcab63 100644 --- a/tests/app/main/views/test_notifications.py +++ b/tests/app/main/views/test_notifications.py @@ -227,29 +227,25 @@ def test_notification_status_shows_expected_back_link( ( "2012-01-01 06:01", ( - "‘sample template’ sample template - service one Was sent on 1 January at 01:01 AM US/Eastern " - "by Test User" + "Was sent on 1 January at 01:01 AM US/Eastern by Test User" ), ), ( "2012-01-02 06:01", ( - "‘sample template’ sample template - service one Was sent on 1 January at 01:01 AM US/Eastern " - "by Test User" + "Was sent on 1 January at 01:01 AM US/Eastern by Test User" ), ), ( "2012-01-03 06:01", ( - "‘sample template’ sample template - service one Was sent on 1 January at 01:01 AM US/Eastern " - "by Test User" + "Was sent on 1 January at 01:01 AM US/Eastern by Test User" ), ), ( "2013-01-03 06:01", ( - "‘sample template’ sample template - service one Was sent on 1 January at 01:01 AM US/Eastern " - "by Test User" + "Was sent on 1 January at 01:01 AM US/Eastern by Test User" ), ), ], @@ -275,10 +271,8 @@ def test_notification_page_doesnt_link_to_template_in_tour( notification_id=fake_uuid, help=3, ) - - assert normalize_spaces(page.select("main p:nth-of-type(1)")[0].text) == ( - expected_message - ) + p_text = normalize_spaces(page.select_one(".usa-alert__text").text) + assert p_text == normalize_spaces(expected_message) assert len(page.select("main p:nth-of-type(1) a")) == 0