Don’t allow paragraphs without class attribute

All paragraphs should have class="govuk-body", or be otherwise
custom-styled. This commit adds some extra checks to our test fixture
that looks for paragraphs that don’t have any styling. Our test coverage
is pretty good, so this should check almost all pages, and prevent
regressions.

I’ve done this in such a way that it can be extended for other elements
(e.g. links) in the future.
This commit is contained in:
Chris Hill-Scott
2020-05-29 17:11:01 +01:00
parent 82ec03e263
commit 4df99bd27f
134 changed files with 517 additions and 497 deletions
@@ -29,7 +29,7 @@
<h1 class='banner-title' data-module="track-error" data-error-type="Too many rows" data-error-label="{{ upload_id }}">
Your file has too many rows
</h1>
<p>
<p class="govuk-body">
Notify can store files up to
{{ "{:,}".format(recipients.max_rows) }} rows in size. Your
file has {{ "{:,}".format(recipients|length) }} rows.
@@ -42,7 +42,7 @@
{{ 'this' if recipients|length == 1 else 'these' }}
{{ recipient_count_label(recipients|length, recipients.template_type) }}
</h1>
<p>
<p class="govuk-body">
In <a class="govuk-link govuk-link--no-visited-state" href="{{ url_for('.trial_mode_new') }}">trial mode</a> you can only
send to yourself and members of your team
</p>
@@ -27,14 +27,14 @@
<h1 class='banner-title' data-module="track-error" data-error-type="Bad rows" data-error-label="{{ upload_id }}">
Theres a problem with {{ original_file_name }}
</h1>
<p>
<p class="govuk-body">
You need to {{ row_errors[0] }}.
</p>
{% else %}
<h1 class='banner-title' data-module="track-error" data-error-type="Bad rows" data-error-label="{{ upload_id }}">
There are some problems with {{ original_file_name }}
</h1>
<p>
<p class="govuk-body">
You need to:
</p>
<ul class="list-bullet">
@@ -29,7 +29,7 @@
<h1 class='banner-title' data-module="track-error" data-error-type="No rows" data-error-label="{{ upload_id }}">
Your file is missing some rows
</h1>
<p>
<p class="govuk-body">
It needs at least one row of data
{%- if template_type %}.{% else %}, in a column called email address or phone number.{% endif %}
</p>
@@ -39,7 +39,7 @@
<h1 class='banner-title' data-module="track-error" data-error-type="Too many rows" data-error-label="{{ upload_id }}">
Your file needs a column called email address or phone number.
</h1>
<p>
<p class="govuk-body">
Right now it has 1 column called {{ recipients._raw_column_headers[0] }}.
</p>
@@ -48,10 +48,10 @@
<h1 class='banner-title' data-module="track-error" data-error-type="Too many rows" data-error-label="{{ upload_id }}">
Your file has too many columns
</h1>
<p>
<p class="govuk-body">
It needs to have 1 column, called email address or phone number.
</p>
<p>
<p class="govuk-body">
Right now it has {{ recipients._raw_column_headers|length }} columns called {{ recipients._raw_column_headers | formatted_list }}.
</p>
@@ -13,7 +13,7 @@
{% call banner_wrapper(type='dangerous') %}
<h1 class="banner-title">{{ error.title }}</h1>
{% if error.detail %}
<p>{{ error.detail | safe }}</p>
<p class="govuk-body">{{ error.detail | safe }}</p>
{% endif %}
{% endcall %}
{% else %}