Make sure errors on one-off flow have red border

When I split up the error messages on the check CSV page into multiple
templates, I also reduced the repetition of wrapping `<div>`s and macro
calls by moving them up outside the conditional blocks (see
8e947f315d).

Unfortunately I didn’t make the same adjustments for the one-off flow,
which meant that errors on these pages lost their styling. This commit
re-adds the styling for these error messages.
This commit is contained in:
Chris Hill-Scott
2017-07-25 22:57:01 +01:00
parent 2c768544d9
commit 2291c4faf4
2 changed files with 23 additions and 11 deletions

View File

@@ -1,5 +1,5 @@
{% extends "withnav_template.html" %}
{% from "components/radios.html" import radio_select %}
{% from "components/banner.html" import banner_wrapper %}
{% from "components/message-count-label.html" import message_count_label %}
{% block service_page_title %}
@@ -8,17 +8,29 @@
{% block maincolumn_content %}
{% if error == 'not-allowed-to-send-to' %}
{% with
count_of_recipients=1,
template_type_label='phone number'
%}
{% include "partials/check/not-allowed-to-send-to.html" %}
{% endwith %}
<div class="bottom-gutter">
{% call banner_wrapper(type='dangerous') %}
{% with
count_of_recipients=1,
template_type_label='phone number'
%}
{% include "partials/check/not-allowed-to-send-to.html" %}
{% endwith %}
{% endcall %}
</div>
{% elif error == 'too-many-messages' %}
{% include "partials/check/too-many-messages.html" %}
<div class="bottom-gutter">
{% call banner_wrapper(type='dangerous') %}
{% include "partials/check/too-many-messages.html" %}
{% endcall %}
</div>
{% elif error == 'message-too-long' %}
{# the only row_errors we can get when sending one off messages is that the message is too long #}
{% include "partials/check/message-too-long.html" %}
<div class="bottom-gutter">
{% call banner_wrapper(type='dangerous') %}
{% include "partials/check/message-too-long.html" %}
{% endcall %}
</div>
{% else %}
<h1 class="heading-large">
Preview of {{ template.name }}

View File

@@ -1937,6 +1937,6 @@ def test_send_notification_shows_error_if_400(
_expected_status=200
)
assert ' '.join(page.h1.text.split()) == expected_h1
assert ' '.join(page.h1.parent.p.text.split()) == expected_err_details
assert normalize_spaces(page.select('.banner-dangerous h1')[0].text) == expected_h1
assert normalize_spaces(page.select('.banner-dangerous p')[0].text) == expected_err_details
assert not page.find('input[type=submit]')