mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-24 20:31:19 -05:00
Merge pull request #3735 from alphagov/show-allowed-broadcast-provider
show allowed broadcast provider
This commit is contained in:
@@ -46,7 +46,8 @@ class Service(JSONModel):
|
||||
'consent_to_research',
|
||||
'count_as_live',
|
||||
'go_live_user',
|
||||
'go_live_at'
|
||||
'go_live_at',
|
||||
'allowed_broadcast_provider',
|
||||
}
|
||||
|
||||
TEMPLATE_TYPES = (
|
||||
|
||||
@@ -19,10 +19,14 @@
|
||||
{{ current_service.name }}
|
||||
{% if current_service.has_permission('broadcast') %}
|
||||
{% if current_service.trial_mode %}
|
||||
<span class="navigation-service-type navigation-service-type--training">Training</span>
|
||||
<span class="navigation-service-type navigation-service-type--training">Training
|
||||
{% else %}
|
||||
<span class="navigation-service-type navigation-service-type--live">Live</span>
|
||||
<span class="navigation-service-type navigation-service-type--live">Live
|
||||
{% endif %}
|
||||
{% if current_service.allowed_broadcast_provider %}
|
||||
({{ current_service.allowed_broadcast_provider }})
|
||||
{% endif %}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
<a href="{{ url_for('main.choose_account') }}" class="govuk-link govuk-link--no-visited-state navigation-service-switch">Switch service</a>
|
||||
|
||||
@@ -192,19 +192,36 @@ def test_broadcast_tour_page_4_shows_service_name(
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('trial_mode, selector, expected_text, expected_tagged_text', (
|
||||
@pytest.mark.parametrize('trial_mode, allowed_broadcast_provider, selector, expected_text, expected_tagged_text', (
|
||||
(
|
||||
True,
|
||||
None,
|
||||
'.navigation-service-type.navigation-service-type--training',
|
||||
'service one Training Switch service',
|
||||
'Training',
|
||||
),
|
||||
(
|
||||
False,
|
||||
None,
|
||||
'.navigation-service-type.navigation-service-type--live',
|
||||
'service one Live Switch service',
|
||||
'Live',
|
||||
),
|
||||
|
||||
(
|
||||
True,
|
||||
'vodafone',
|
||||
'.navigation-service-type.navigation-service-type--training',
|
||||
'service one Training (vodafone) Switch service',
|
||||
'Training (vodafone)',
|
||||
),
|
||||
(
|
||||
False,
|
||||
'vodafone',
|
||||
'.navigation-service-type.navigation-service-type--live',
|
||||
'service one Live (vodafone) Switch service',
|
||||
'Live (vodafone)',
|
||||
),
|
||||
))
|
||||
def test_broadcast_service_shows_live_or_training(
|
||||
client_request,
|
||||
@@ -212,10 +229,12 @@ def test_broadcast_service_shows_live_or_training(
|
||||
mock_get_no_broadcast_messages,
|
||||
mock_get_service_templates_when_no_templates_exist,
|
||||
trial_mode,
|
||||
allowed_broadcast_provider,
|
||||
selector,
|
||||
expected_text,
|
||||
expected_tagged_text,
|
||||
):
|
||||
service_one['allowed_broadcast_provider'] = allowed_broadcast_provider
|
||||
service_one['permissions'] += ['broadcast']
|
||||
service_one['restricted'] = trial_mode
|
||||
page = client_request.get(
|
||||
|
||||
Reference in New Issue
Block a user