mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-08 04:08:25 -04:00
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:
@@ -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.'
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user