mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 00:07:02 -04:00
Add test for back link on view broadcast page
This commit is contained in:
@@ -1118,26 +1118,31 @@ def test_view_broadcast_message_page(
|
|||||||
'.view_current_broadcast',
|
'.view_current_broadcast',
|
||||||
'.view_previous_broadcast',
|
'.view_previous_broadcast',
|
||||||
))
|
))
|
||||||
@pytest.mark.parametrize('status, expected_highlighted_navigation_item', (
|
@pytest.mark.parametrize('status, expected_highlighted_navigation_item, expected_back_link_endpoint', (
|
||||||
(
|
(
|
||||||
'pending-approval',
|
'pending-approval',
|
||||||
'Current alerts',
|
'Current alerts',
|
||||||
|
'.broadcast_dashboard',
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
'broadcasting',
|
'broadcasting',
|
||||||
'Current alerts',
|
'Current alerts',
|
||||||
|
'.broadcast_dashboard',
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
'completed',
|
'completed',
|
||||||
'Previous alerts',
|
'Previous alerts',
|
||||||
|
'.broadcast_dashboard_previous',
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
'cancelled',
|
'cancelled',
|
||||||
'Previous alerts',
|
'Previous alerts',
|
||||||
|
'.broadcast_dashboard_previous',
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
'rejected',
|
'rejected',
|
||||||
'Previous alerts',
|
'Previous alerts',
|
||||||
|
'.broadcast_dashboard_previous',
|
||||||
),
|
),
|
||||||
))
|
))
|
||||||
@freeze_time('2020-02-22T22:22:22.000000')
|
@freeze_time('2020-02-22T22:22:22.000000')
|
||||||
@@ -1151,6 +1156,7 @@ def test_view_broadcast_message_shows_correct_highlighted_navigation(
|
|||||||
endpoint,
|
endpoint,
|
||||||
status,
|
status,
|
||||||
expected_highlighted_navigation_item,
|
expected_highlighted_navigation_item,
|
||||||
|
expected_back_link_endpoint,
|
||||||
):
|
):
|
||||||
mocker.patch(
|
mocker.patch(
|
||||||
'app.broadcast_message_api_client.get_broadcast_message',
|
'app.broadcast_message_api_client.get_broadcast_message',
|
||||||
@@ -1181,6 +1187,11 @@ def test_view_broadcast_message_shows_correct_highlighted_navigation(
|
|||||||
expected_highlighted_navigation_item
|
expected_highlighted_navigation_item
|
||||||
)
|
)
|
||||||
|
|
||||||
|
assert page.select_one('.govuk-back-link')['href'] == url_for(
|
||||||
|
expected_back_link_endpoint,
|
||||||
|
service_id=SERVICE_ONE_ID,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@freeze_time('2020-02-22T22:22:22.000000')
|
@freeze_time('2020-02-22T22:22:22.000000')
|
||||||
def test_view_pending_broadcast(
|
def test_view_pending_broadcast(
|
||||||
|
|||||||
Reference in New Issue
Block a user