Add the new alert button to previous alerts page

Feels like it should behave the same way as the current alerts page.
This commit is contained in:
Chris Hill-Scott
2021-01-18 16:46:13 +00:00
parent 99b7d8a66f
commit 8f2dc72881
2 changed files with 26 additions and 1 deletions

View File

@@ -357,16 +357,20 @@ def test_broadcast_dashboard(
)
@pytest.mark.parametrize('endpoint', (
'.broadcast_dashboard', '.broadcast_dashboard_previous',
))
def test_broadcast_dashboard_does_not_have_button_for_view_only_user(
client_request,
service_one,
active_user_view_permissions,
mock_get_broadcast_messages,
endpoint,
):
service_one['permissions'] += ['broadcast']
client_request.login(active_user_view_permissions)
page = client_request.get(
'.broadcast_dashboard',
endpoint,
service_id=SERVICE_ONE_ID,
)
assert not page.select('a.govuk-button')
@@ -420,6 +424,15 @@ def test_previous_broadcasts_page(
'Example template This is a test Broadcast yesterday at 2:20am England Scotland',
]
button = page.select_one(
'.js-stick-at-bottom-when-scrolling a.govuk-button.govuk-button--secondary'
)
assert normalize_spaces(button.text) == 'New alert'
assert button['href'] == url_for(
'main.new_broadcast',
service_id=SERVICE_ONE_ID,
)
def test_new_broadcast_page(
client_request,