Refactor uploads preview error banner to use a shared component

Also refactor a corresponding test to avoid asserting on the content
This commit is contained in:
Pea Tyczynska
2019-10-24 22:57:05 +01:00
parent f2c7eb5c3e
commit 5e10ed23a1
5 changed files with 14 additions and 18 deletions

View File

@@ -249,11 +249,7 @@ def test_post_upload_letter_with_invalid_file(mocker, client_request):
message='content-outside-printable-area'
)
assert page.find('div', class_='banner-dangerous').find('h1').text == 'We cannot print your letter'
assert page.find(
'div', class_='banner-dangerous').find('p').text == (
'The content appears outside the printable area on page 1 Files must meet our letter specification.'
)
assert page.find('div', class_='banner-dangerous').find('h1', {"data-error-type": 'content-outside-printable-area'})
assert not page.find('button', {'type': 'submit'})