mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 08:16:51 -04:00
Make a separate page for previous alerts
Previous alerts are much less important than ones that are live or waiting for approval. Therefore we can make the dashboard more focused by moving previous alerts to their own page.
This commit is contained in:
@@ -22,6 +22,10 @@ sample_uuid = sample_uuid()
|
||||
'.broadcast_dashboard_updates', {},
|
||||
403, 405,
|
||||
),
|
||||
(
|
||||
'.broadcast_dashboard_previous', {},
|
||||
403, 405,
|
||||
),
|
||||
(
|
||||
'.broadcast',
|
||||
{'template_id': sample_uuid},
|
||||
@@ -348,6 +352,31 @@ def test_broadcast_dashboard_json(
|
||||
assert 'Finished yesterday at 8:20pm' in json_response['previous_broadcasts']
|
||||
|
||||
|
||||
@freeze_time('2020-02-20 02:20')
|
||||
def test_previous_broadcasts_page(
|
||||
client_request,
|
||||
service_one,
|
||||
mock_get_broadcast_messages,
|
||||
mock_get_service_templates,
|
||||
):
|
||||
service_one['permissions'] += ['broadcast']
|
||||
page = client_request.get(
|
||||
'.broadcast_dashboard_previous',
|
||||
service_id=SERVICE_ONE_ID,
|
||||
)
|
||||
|
||||
assert normalize_spaces(page.select_one('main h1').text) == (
|
||||
'Previous alerts'
|
||||
)
|
||||
assert len(page.select('table')) == 1
|
||||
assert [
|
||||
normalize_spaces(row.text) for row in page.select('table')[0].select('tbody tr')
|
||||
] == [
|
||||
'Example template To England and Scotland Stopped 10 February at 2:20am',
|
||||
'Example template To England and Scotland Finished yesterday at 8:20pm',
|
||||
]
|
||||
|
||||
|
||||
def test_broadcast_page(
|
||||
client_request,
|
||||
service_one,
|
||||
|
||||
@@ -189,6 +189,7 @@ def test_navigation_for_services_with_broadcast_permission(
|
||||
a['href'] for a in page.select('.navigation a')
|
||||
] == [
|
||||
'/services/{}/broadcast-dashboard'.format(SERVICE_ONE_ID),
|
||||
'/services/{}/previous-alerts'.format(SERVICE_ONE_ID),
|
||||
'/services/{}/templates'.format(SERVICE_ONE_ID),
|
||||
'/services/{}/users'.format(SERVICE_ONE_ID),
|
||||
'/services/{}/service-settings'.format(SERVICE_ONE_ID),
|
||||
|
||||
Reference in New Issue
Block a user