mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-05 22:21:34 -04:00
Add re-upload button and back link to the preview page
Re-upload button is only shown if file failed validation. Change wording of re-upload buttons Make test we test right buttons on letter upload preview page Also remove double backlink
This commit is contained in:
@@ -417,7 +417,7 @@ def test_upload_csv_file_with_errors_shows_check_page_with_errors(
|
||||
assert 'There is a problem with invalid.csv' in content
|
||||
assert '+447700900986' in content
|
||||
assert 'Missing' in content
|
||||
assert 'Re-upload your file' in content
|
||||
assert 'Upload your file again' in content
|
||||
|
||||
|
||||
@pytest.mark.parametrize('file_contents, expected_error,', [
|
||||
|
||||
@@ -265,7 +265,7 @@ def test_post_upload_letter_with_invalid_file(mocker, client_request, fake_uuid)
|
||||
)
|
||||
|
||||
assert page.find('div', class_='banner-dangerous').find('h1', {"data-error-type": 'content-outside-printable-area'})
|
||||
assert not page.find('button', {'type': 'submit'})
|
||||
assert not page.find('button', {'class': 'button', 'type': 'submit'})
|
||||
|
||||
|
||||
def test_post_upload_letter_shows_letter_preview_for_invalid_file(mocker, client_request, fake_uuid):
|
||||
@@ -298,6 +298,9 @@ def test_post_upload_letter_shows_letter_preview_for_invalid_file(mocker, client
|
||||
assert 'The Queen' not in page.text
|
||||
assert len(page.select('.letter-postage')) == 0
|
||||
|
||||
assert page.find("a", {"class": "govuk-back-link"})["href"] == "/services/{}/upload-letter".format(SERVICE_ONE_ID)
|
||||
assert page.find("label", {"class": "file-upload-button"})
|
||||
|
||||
letter_images = page.select('main img')
|
||||
assert len(letter_images) == 1
|
||||
assert letter_images[0]['src'] == url_for(
|
||||
@@ -357,6 +360,8 @@ def test_uploaded_letter_preview(
|
||||
|
||||
assert page.find('h1').text == 'my_letter.pdf'
|
||||
assert page.find('div', class_='letter-sent')
|
||||
assert not page.find("label", {"class": "file-upload-button"})
|
||||
assert page.find('button', {'class': 'button', 'type': 'submit'})
|
||||
|
||||
|
||||
def test_uploaded_letter_preview_does_not_show_send_button_if_service_in_trial_mode(
|
||||
|
||||
Reference in New Issue
Block a user