Fix order of placeholders in the tour

Doing a lookup with `step_index - 1` means that on step `0` we were
looking up `placeholders[-1]`, ie we were making people fill in the last
placeholder first.

Fixing this reintroduces the bug fixed by this pull request:
https://github.com/alphagov/notifications-admin/pull/2551

So this commit also re-fixes that bug but in a different way.
This commit is contained in:
Chris Hill-Scott
2019-05-03 13:07:00 +01:00
parent 0508d4a1fc
commit 34171f3038
3 changed files with 105 additions and 7 deletions

View File

@@ -845,6 +845,20 @@ def mock_get_service_template_with_placeholders(mocker):
)
@pytest.fixture(scope='function')
def mock_get_service_template_with_multiple_placeholders(mocker):
def _get(service_id, template_id, version=None):
template = template_json(
service_id, template_id, "Two week reminder", "sms", "((one)) ((two)) ((three))"
)
return {'data': template}
return mocker.patch(
'app.service_api_client.get_service_template',
side_effect=_get
)
@pytest.fixture(scope='function')
def mock_get_service_template_with_placeholders_same_as_recipient(mocker):
def _get(service_id, template_id, version=None):