mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-03 23:51:22 -04:00
Merge pull request #1343 from alphagov/show-template-as-first-step-of-tour
Change step 1 of tour to only show the template
This commit is contained in:
@@ -59,10 +59,9 @@ def test_should_add_service_and_redirect_to_tour_when_no_services(
|
||||
assert session['service_id'] == 101
|
||||
assert response.status_code == 302
|
||||
assert response.location == url_for(
|
||||
'main.send_test',
|
||||
'main.start_tour',
|
||||
service_id=101,
|
||||
template_id="Example text message template",
|
||||
help=1,
|
||||
template_id="Example%20text%20message%20template",
|
||||
_external=True
|
||||
)
|
||||
|
||||
|
||||
@@ -944,6 +944,57 @@ def test_should_create_sms_template_without_downgrading_unicode_characters(
|
||||
assert resp.status_code == 302
|
||||
|
||||
|
||||
def test_should_show_template_as_first_page_of_tour(
|
||||
client_request,
|
||||
mock_get_service_template,
|
||||
service_one,
|
||||
fake_uuid,
|
||||
):
|
||||
|
||||
page = client_request.get(
|
||||
'main.start_tour',
|
||||
service_id=SERVICE_ONE_ID,
|
||||
template_id=fake_uuid,
|
||||
)
|
||||
|
||||
assert normalize_spaces(
|
||||
page.select('.banner-tour .heading-medium')[0].text
|
||||
) == (
|
||||
'Try sending yourself this example'
|
||||
)
|
||||
|
||||
assert normalize_spaces(
|
||||
page.select('.sms-message-wrapper')[0].text
|
||||
) == (
|
||||
'service one: Template <em>content</em> with & entity'
|
||||
)
|
||||
|
||||
assert page.select('a.button')[0]['href'] == url_for(
|
||||
'.send_test', service_id=SERVICE_ONE_ID, template_id=fake_uuid, help=2
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('template_mock', [
|
||||
mock_get_service_email_template,
|
||||
mock_get_service_letter_template,
|
||||
])
|
||||
def test_cant_see_email_template_in_tour(
|
||||
client_request,
|
||||
fake_uuid,
|
||||
mocker,
|
||||
template_mock,
|
||||
):
|
||||
|
||||
template_mock(mocker)
|
||||
|
||||
client_request.get(
|
||||
'main.start_tour',
|
||||
service_id=SERVICE_ONE_ID,
|
||||
template_id=fake_uuid,
|
||||
_expected_status=404,
|
||||
)
|
||||
|
||||
|
||||
def test_should_show_message_before_redacting_template(
|
||||
client_request,
|
||||
mock_get_service_template,
|
||||
|
||||
Reference in New Issue
Block a user