mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 16:24:08 -04:00
Add a version of the tour for live services
At the moment if you’re invited to a live broadcast service you get the training mode tour. This is misleading, and could make people think they weren’t in danger of sending a real alert. This commit adds a short, 2 step tour for users invited to a live broadcast service.
This commit is contained in:
@@ -236,24 +236,27 @@ def test_cancel_broadcast_page_403_for_user_without_permission(
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('step_index, expected_link_text, expected_link_href', (
|
||||
(1, 'Continue', partial(url_for, '.broadcast_tour', step_index=2)),
|
||||
(2, 'Continue', partial(url_for, '.broadcast_tour', step_index=3)),
|
||||
(3, 'Continue', partial(url_for, '.broadcast_tour', step_index=4)),
|
||||
(4, 'Continue', partial(url_for, '.broadcast_tour', step_index=5)),
|
||||
(5, 'Continue', partial(url_for, '.service_dashboard')),
|
||||
(6, 'Continue', partial(url_for, '.service_dashboard')),
|
||||
@pytest.mark.parametrize('endpoint, step_index, expected_link_text, expected_link_href', (
|
||||
('.broadcast_tour', 1, 'Continue', partial(url_for, '.broadcast_tour', step_index=2)),
|
||||
('.broadcast_tour', 2, 'Continue', partial(url_for, '.broadcast_tour', step_index=3)),
|
||||
('.broadcast_tour', 3, 'Continue', partial(url_for, '.broadcast_tour', step_index=4)),
|
||||
('.broadcast_tour', 4, 'Continue', partial(url_for, '.broadcast_tour', step_index=5)),
|
||||
('.broadcast_tour', 5, 'Continue', partial(url_for, '.service_dashboard')),
|
||||
('.broadcast_tour', 6, 'Continue', partial(url_for, '.service_dashboard')),
|
||||
('.broadcast_tour_live', 1, 'Continue', partial(url_for, '.broadcast_tour_live', step_index=2)),
|
||||
('.broadcast_tour_live', 2, 'Continue', partial(url_for, '.service_dashboard')),
|
||||
))
|
||||
def test_broadcast_tour_pages_have_continue_link(
|
||||
client_request,
|
||||
service_one,
|
||||
endpoint,
|
||||
step_index,
|
||||
expected_link_text,
|
||||
expected_link_href,
|
||||
):
|
||||
service_one['permissions'] += ['broadcast']
|
||||
page = client_request.get(
|
||||
'.broadcast_tour',
|
||||
endpoint,
|
||||
service_id=SERVICE_ONE_ID,
|
||||
step_index=step_index,
|
||||
)
|
||||
@@ -286,6 +289,28 @@ def test_broadcast_tour_page_4_shows_service_name(
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('step_index', (
|
||||
1,
|
||||
2,
|
||||
))
|
||||
def test_live_broadcast_tour_shows_service_name_and_switch(
|
||||
client_request,
|
||||
service_one,
|
||||
step_index,
|
||||
):
|
||||
service_one['permissions'] += ['broadcast']
|
||||
service_one['restricted'] = False
|
||||
service_one['allowed_broadcast_provider'] = 'all'
|
||||
page = client_request.get(
|
||||
'.broadcast_tour_live',
|
||||
service_id=SERVICE_ONE_ID,
|
||||
step_index=step_index,
|
||||
)
|
||||
assert normalize_spaces(page.select_one('.navigation-service').text) == (
|
||||
'service one Live Switch service'
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
'trial_mode, channel, allowed_broadcast_provider, selector, expected_text, expected_tagged_text',
|
||||
(
|
||||
@@ -371,15 +396,21 @@ def test_broadcast_service_shows_live_or_training(
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('step_index', (0, 7))
|
||||
@pytest.mark.parametrize('endpoint, step_index', (
|
||||
('.broadcast_tour', 0),
|
||||
('.broadcast_tour', 7),
|
||||
('.broadcast_tour_live', 0),
|
||||
('.broadcast_tour_live', 3),
|
||||
))
|
||||
def test_broadcast_tour_page_404s_out_of_range(
|
||||
client_request,
|
||||
service_one,
|
||||
endpoint,
|
||||
step_index,
|
||||
):
|
||||
service_one['permissions'] += ['broadcast']
|
||||
client_request.get(
|
||||
'.broadcast_tour',
|
||||
endpoint,
|
||||
service_id=SERVICE_ONE_ID,
|
||||
step_index=step_index,
|
||||
_expected_status=404,
|
||||
|
||||
Reference in New Issue
Block a user