mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 16:24:08 -04:00
Merge pull request #1364 from alphagov/letter-job-page-real
Customise the job page to make sense for letters
This commit is contained in:
@@ -158,6 +158,77 @@ def test_should_show_job_in_progress(
|
||||
assert page.find('p', {'class': 'hint'}).text.strip() == 'Report is 50% complete…'
|
||||
|
||||
|
||||
@freeze_time("2016-01-01 11:09:00.061258")
|
||||
def test_should_show_letter_job(
|
||||
client_request,
|
||||
mock_get_service_letter_template,
|
||||
mock_get_job,
|
||||
mock_get_notifications,
|
||||
fake_uuid,
|
||||
):
|
||||
|
||||
page = client_request.get(
|
||||
'main.view_job',
|
||||
service_id=SERVICE_ONE_ID,
|
||||
job_id=fake_uuid,
|
||||
)
|
||||
|
||||
assert normalize_spaces(page.h1.text) == 'thisisatest.csv'
|
||||
assert normalize_spaces(page.select('p.bottom-gutter')[0].text) == (
|
||||
'Sent by Test User on 1 January at 11:09am'
|
||||
)
|
||||
assert page.select('.banner-default-with-tick') == []
|
||||
assert normalize_spaces(page.select('tbody tr')[0].text) == (
|
||||
'07123456789 template content'
|
||||
)
|
||||
assert normalize_spaces(page.select('.keyline-block')[0].text) == (
|
||||
'1 Letter'
|
||||
)
|
||||
assert normalize_spaces(page.select('.keyline-block')[1].text) == (
|
||||
'6 January Estimated delivery date'
|
||||
)
|
||||
assert page.select('[download=download]') == []
|
||||
assert page.select('.hint') == []
|
||||
|
||||
mock_get_notifications.assert_called_with(
|
||||
SERVICE_ONE_ID,
|
||||
fake_uuid,
|
||||
status=[
|
||||
'created',
|
||||
'pending',
|
||||
'sending',
|
||||
'delivered',
|
||||
'sent',
|
||||
'failed',
|
||||
'temporary-failure',
|
||||
'permanent-failure',
|
||||
'technical-failure',
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
@freeze_time("2016-01-01 11:09:00.061258")
|
||||
def test_should_show_letter_job_with_banner_after_sending(
|
||||
client_request,
|
||||
mock_get_service_letter_template,
|
||||
mock_get_job,
|
||||
mock_get_notifications,
|
||||
fake_uuid,
|
||||
):
|
||||
|
||||
page = client_request.get(
|
||||
'main.view_job',
|
||||
service_id=SERVICE_ONE_ID,
|
||||
job_id=fake_uuid,
|
||||
just_sent='yes',
|
||||
)
|
||||
|
||||
assert page.select('p.bottom-gutter') == []
|
||||
assert normalize_spaces(page.select('.banner-default-with-tick')[0].text) == (
|
||||
'We’ve started printing your letters'
|
||||
)
|
||||
|
||||
|
||||
@freeze_time("2016-01-01T00:00:00.061258")
|
||||
def test_should_show_scheduled_job(
|
||||
logged_in_client,
|
||||
|
||||
@@ -1170,6 +1170,7 @@ def test_can_start_letters_job(
|
||||
data={}
|
||||
)
|
||||
assert response.status_code == 302
|
||||
assert 'just_sent=yes' in response.location
|
||||
|
||||
|
||||
@pytest.mark.parametrize('filetype', ['pdf', 'png'])
|
||||
|
||||
Reference in New Issue
Block a user