Add some summaries of letter validation errors

We show letter validation errors in two places:

1. In response to a user uploading a PDF
   Here we use the error banner pattern because the problem is as a
   direct consequence of a user’s action, and is blocking them from
   continuing.

2. Once a PDF provided through the API has been validated
   We use a less prominent pattern of red text with no border because
   the message is reporting on something that’s already happened, and
   which wasn’t a direct consequence of the user clicking something

Because the context and patterns used are different we need slightly
different content in each of these situations. Previously we tried to
reuse the same content to make the code cleaner and less repetitive. But
ultimately a clear interface trumps clear code.
This commit is contained in:
Chris Hill-Scott
2020-01-10 17:29:58 +00:00
parent a186d0eeff
commit 540945539b
4 changed files with 75 additions and 14 deletions

View File

@@ -332,7 +332,7 @@ def test_notification_page_shows_validation_failed_precompiled_letter(
error_message = page.find('p', class_='notification-status-cancelled').text
assert normalize_spaces(error_message) == (
'Validation failed. You need to edit page 1.'
'Validation failed because content is outside the printable area on page 1.'
'Files must meet our letter specification.'
)