mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-02 23:20:56 -04:00
Replace message previews on check page with table
The first 3/last 3 messages didn’t test well, it wasn’t immediately obvious what was going on. This commit replaces it with just a preview of the first message, and a table showing the details of the subsequent messages.
This commit is contained in:
@@ -87,50 +87,13 @@ def test_upload_csvfile_with_invalid_phone_shows_check_page_with_errors(app_,
|
||||
|
||||
|
||||
@moto.mock_s3
|
||||
def test_upload_csvfile_with_valid_phone_shows_first3_and_last3_numbers(app_,
|
||||
mocker,
|
||||
api_user_active,
|
||||
mock_get_user,
|
||||
mock_get_user_by_email,
|
||||
mock_login,
|
||||
mock_get_service_template):
|
||||
contents = 'phone\n+44 7700 900981\n+44 7700 900982\n+44 7700 900983\n+44 7700 900984\n+44 7700 900985\n+44 7700 900986\n+44 7700 900987\n+44 7700 900988\n+44 7700 900989' # noqa
|
||||
|
||||
file_data = (BytesIO(contents.encode('utf-8')), 'valid.csv')
|
||||
|
||||
with app_.test_request_context():
|
||||
with app_.test_client() as client:
|
||||
client.login(api_user_active)
|
||||
upload_data = {'file': file_data}
|
||||
response = client.post(url_for('main.send_sms', service_id=12345, template_id=54321),
|
||||
data=upload_data,
|
||||
follow_redirects=True)
|
||||
|
||||
content = response.get_data(as_text=True)
|
||||
|
||||
assert response.status_code == 200
|
||||
assert 'Check and confirm' in content
|
||||
assert 'First three message in file' in content
|
||||
assert 'Last three messages in file' in content
|
||||
assert '+44 7700 900981' in content
|
||||
assert '+44 7700 900982' in content
|
||||
assert '+44 7700 900983' in content
|
||||
assert '+44 7700 900984' not in content
|
||||
assert '+44 7700 900985' not in content
|
||||
assert '+44 7700 900986' not in content
|
||||
assert '+44 7700 900987' in content
|
||||
assert '+44 7700 900988' in content
|
||||
assert '+44 7700 900989' in content
|
||||
|
||||
|
||||
@moto.mock_s3
|
||||
def test_upload_csvfile_with_valid_phone_shows_all_if_6_or_less_numbers(app_,
|
||||
mocker,
|
||||
api_user_active,
|
||||
mock_get_user,
|
||||
mock_get_user_by_email,
|
||||
mock_login,
|
||||
mock_get_service_template):
|
||||
def test_upload_csvfile_with_valid_phone_shows_all_numbers(app_,
|
||||
mocker,
|
||||
api_user_active,
|
||||
mock_get_user,
|
||||
mock_get_user_by_email,
|
||||
mock_login,
|
||||
mock_get_service_template):
|
||||
|
||||
contents = 'phone\n+44 7700 900981\n+44 7700 900982\n+44 7700 900983\n+44 7700 900984\n+44 7700 900985\n+44 7700 900986' # noqa
|
||||
|
||||
@@ -147,8 +110,6 @@ def test_upload_csvfile_with_valid_phone_shows_all_if_6_or_less_numbers(app_,
|
||||
content = response.get_data(as_text=True)
|
||||
|
||||
assert response.status_code == 200
|
||||
assert 'Check and confirm' in content
|
||||
assert 'All messages in file' in content
|
||||
assert '+44 7700 900981' in content
|
||||
assert '+44 7700 900982' in content
|
||||
assert '+44 7700 900983' in content
|
||||
|
||||
Reference in New Issue
Block a user