diff --git a/app/assets/images/envelope-international.svg b/app/assets/images/envelope-international.svg new file mode 100644 index 000000000..4bebb1dce --- /dev/null +++ b/app/assets/images/envelope-international.svg @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/assets/stylesheets/components/letter.scss b/app/assets/stylesheets/components/letter.scss index 84503da16..d23408248 100644 --- a/app/assets/stylesheets/components/letter.scss +++ b/app/assets/stylesheets/components/letter.scss @@ -70,6 +70,10 @@ $iso-paper-ratio: 141.42135624%; background-image: file-url('envelope-2nd-class.svg'); } + &-international { + background-image: file-url('envelope-international.svg'); + } + .letter-sent &:hover { background-color: transparent; border-color: transparent; diff --git a/requirements-app.txt b/requirements-app.txt index c2c1d11ed..b9baba9f4 100644 --- a/requirements-app.txt +++ b/requirements-app.txt @@ -23,5 +23,5 @@ notifications-python-client==5.5.1 awscli-cwlogs>=1.4,<1.5 itsdangerous==1.1.0 -git+https://github.com/alphagov/notifications-utils.git@39.0.1#egg=notifications-utils==39.0.1 +git+https://github.com/alphagov/notifications-utils.git@39.1.0#egg=notifications-utils==39.1.0 git+https://github.com/alphagov/govuk-frontend-jinja.git@v0.5.1-alpha#egg=govuk-frontend-jinja==0.5.1-alpha diff --git a/requirements.txt b/requirements.txt index aaf4d053c..377da5a7e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -25,14 +25,14 @@ notifications-python-client==5.5.1 awscli-cwlogs>=1.4,<1.5 itsdangerous==1.1.0 -git+https://github.com/alphagov/notifications-utils.git@39.0.1#egg=notifications-utils==39.0.1 +git+https://github.com/alphagov/notifications-utils.git@39.1.0#egg=notifications-utils==39.1.0 git+https://github.com/alphagov/govuk-frontend-jinja.git@v0.5.1-alpha#egg=govuk-frontend-jinja==0.5.1-alpha ## The following requirements were added by pip freeze: -awscli==1.18.53 +awscli==1.18.60 bleach==3.1.4 boto3==1.10.38 -botocore==1.16.3 +botocore==1.16.10 certifi==2020.4.5.1 chardet==3.0.4 click==7.1.2 @@ -47,7 +47,7 @@ greenlet==0.4.15 idna==2.9 jdcal==1.4.1 Jinja2==2.11.2 -jmespath==0.9.5 +jmespath==0.10.0 lml==0.0.9 lxml==4.5.0 MarkupSafe==1.1.1 @@ -63,7 +63,7 @@ PyPDF2==1.26.0 python-dateutil==2.8.1 python-json-logger==0.1.11 PyYAML==5.3.1 -redis==3.5.0 +redis==3.5.2 requests==2.23.0 rsa==3.4.2 s3transfer==0.3.3 diff --git a/tests/app/main/views/test_notifications.py b/tests/app/main/views/test_notifications.py index 4985af524..3c4c5a8cb 100644 --- a/tests/app/main/views/test_notifications.py +++ b/tests/app/main/views/test_notifications.py @@ -515,16 +515,41 @@ def test_notification_page_does_not_show_cancel_link_for_letter_which_cannot_be_ assert 'Cancel sending this letter' not in normalize_spaces(page.text) +@pytest.mark.parametrize('postage, expected_postage_text, expected_class_value, expected_delivery', ( + ( + 'first', + 'Postage: first class', + 'letter-postage-first', + 'Estimated delivery date: Tuesday 5 January', + ), + ( + 'europe', + 'Postage: international', + 'letter-postage-international', + 'Estimated delivery date: Wednesday 6 January', + ), + ( + 'rest-of-world', + 'Postage: international', + 'letter-postage-international', + 'Estimated delivery date: Wednesday 6 January', + ), +)) @freeze_time("2016-01-01 18:00") -def test_notification_page_shows_page_for_first_class_letter_notification( +def test_notification_page_shows_page_for_other_postage_classes( client_request, mocker, fake_uuid, + postage, + expected_postage_text, + expected_class_value, + expected_delivery, ): notification = create_notification( notification_status='pending-virus-check', template_type='letter', - postage='first') + postage=postage, + ) mocker.patch('app.notification_api_client.get_notification', return_value=notification) mocker.patch('app.main.views.notifications.get_page_count_for_letter', return_value=3) @@ -536,13 +561,13 @@ def test_notification_page_shows_page_for_first_class_letter_notification( assert normalize_spaces(page.select('main p:nth-of-type(2)')[0].text) == 'Printing starts tomorrow at 5:30pm' assert normalize_spaces(page.select('main p:nth-of-type(3)')[0].text) == ( - 'Estimated delivery date: Tuesday 5 January' + expected_delivery ) assert normalize_spaces(page.select_one('.letter-postage').text) == ( - 'Postage: first class' + expected_postage_text ) assert page.select_one('.letter-postage')['class'] == [ - 'letter-postage', 'letter-postage-first' + 'letter-postage', expected_class_value ]