Write test for separate page for service name change for local orgs

Also make a bullet list gov uk style
This commit is contained in:
Pea Tyczynska
2020-07-01 12:16:32 +01:00
parent d0dd6218f7
commit b3bc3a6447
3 changed files with 23 additions and 2 deletions

View File

@@ -87,6 +87,7 @@ def add_service():
heading=heading,
default_organisation_type=default_organisation_type,
)
return render_template(
'views/add-service.html',
form=form,

View File

@@ -17,13 +17,13 @@
{{ page_header('About your service') }}
<p class="govuk-body">Give your service a name that tells users what your messages are about, as well as who theyre from. For example:</p>
<ul class="list-bullet">
<ul class="govuk-list govuk-list--bullet">
<li>School admissions - {{ current_user.default_organisation.name }}</li>
<li>Electoral services - {{ current_user.default_organisation.name }}</li>
<li>Blue Badge - {{ current_user.default_organisation.name }}</li>
</ul>
<p class="govuk-body">You should only use an acronym if your users are already familiar with it.</p>
{% call form_wrapper() %}
{{ textbox(form.name, hint="You can change this later") }}

View File

@@ -383,6 +383,26 @@ def test_should_show_service_name(
app.service_api_client.get_service.assert_called_with(SERVICE_ONE_ID)
def test_should_show_different_change_service_name_page_for_local_services(
client_request,
service_one,
mocker,
):
mocker.patch(
'app.organisations_client.get_organisation_by_domain',
return_value=organisation_json(organisation_type='local'),
)
service_one['organisation_type'] = 'local'
page = client_request.get('main.service_name_change', service_id=SERVICE_ONE_ID)
assert page.find('h1').text == 'Change your service name'
assert page.find('input', attrs={"type": "text"})['value'] == 'service one'
assert page.select_one('main .govuk-body').text.strip() == (
'Your service name should tell users what the message is about as well as who its from. For example:'
)
app.service_api_client.get_service.assert_called_with(SERVICE_ONE_ID)
def test_should_show_service_name_with_no_prefixing(
client_request,
service_one,