Refactor service name code to reduce duplication

This makes the code shareable between:
- the broadcast tour pages
- the broadcast settings platform admin page
- the regular service navigation

On the training mode tour pages we don’t want to confuse people with the
organisation name or _Switch service_ links, so those are omitted and
the code is therefore slightly different.
This commit is contained in:
Chris Hill-Scott
2021-05-19 09:39:38 +01:00
parent 766df5d1ca
commit 016f38db9b
5 changed files with 53 additions and 52 deletions

View File

@@ -284,7 +284,9 @@ def test_broadcast_tour_page_4_shows_service_name(
service_id=SERVICE_ONE_ID,
step_index=step_index,
)
assert normalize_spaces(page.select_one('.navigation-service').text) == (
assert normalize_spaces(
page.select_one('.navigation-service').text
).startswith(
'service one Training'
)
@@ -301,6 +303,7 @@ def test_live_broadcast_tour_shows_service_name_and_switch(
service_one['permissions'] += ['broadcast']
service_one['restricted'] = False
service_one['allowed_broadcast_provider'] = 'all'
service_one['broadcast_channel'] = 'severe'
page = client_request.get(
'.broadcast_tour_live',
service_id=SERVICE_ONE_ID,
@@ -351,8 +354,8 @@ def test_live_broadcast_tour_shows_service_name_and_switch(
'test',
'vodafone',
'.navigation-service-type.navigation-service-type--live',
'service one Test (vodafone) Switch service',
'Test (vodafone)',
'service one Test (Vodafone) Switch service',
'Test (Vodafone)',
),
(
False,