mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-18 21:49:37 -04:00
Add 'Uploads' hub and navigation
The uploads hub is just a page with text for now - there are no actions available on the page. It is linked to from a new 'Uploads' menu item on the left of the page which is only visible if your service has the `letter` and `upload_letters` permissions and if the current user has permissions to send messages.
This commit is contained in:
@@ -960,6 +960,8 @@ def test_menu_send_messages(
|
||||
mock_get_inbound_sms_summary,
|
||||
mock_get_free_sms_fragment_limit,
|
||||
):
|
||||
service_one['permissions'] = ['email', 'sms', 'letter', 'upload_letters']
|
||||
|
||||
with app_.test_request_context():
|
||||
resp = _test_dashboard_menu(
|
||||
mocker,
|
||||
@@ -972,6 +974,7 @@ def test_menu_send_messages(
|
||||
'main.choose_template',
|
||||
service_id=service_one['id'],
|
||||
) in page
|
||||
assert url_for('main.uploads', service_id=service_one['id']) in page
|
||||
assert url_for('main.manage_users', service_id=service_one['id']) in page
|
||||
|
||||
assert url_for('main.service_settings', service_id=service_one['id']) not in page
|
||||
@@ -979,6 +982,30 @@ def test_menu_send_messages(
|
||||
assert url_for('main.view_providers') not in page
|
||||
|
||||
|
||||
def test_menu_send_messages_when_service_does_not_have_upload_letters_permission(
|
||||
mocker,
|
||||
app_,
|
||||
api_user_active,
|
||||
service_one,
|
||||
mock_get_service_templates,
|
||||
mock_get_jobs,
|
||||
mock_get_template_statistics,
|
||||
mock_get_service_statistics,
|
||||
mock_get_usage,
|
||||
mock_get_inbound_sms_summary,
|
||||
mock_get_free_sms_fragment_limit,
|
||||
):
|
||||
with app_.test_request_context():
|
||||
resp = _test_dashboard_menu(
|
||||
mocker,
|
||||
app_,
|
||||
api_user_active,
|
||||
service_one,
|
||||
['view_activity', 'send_messages'])
|
||||
page = resp.get_data(as_text=True)
|
||||
assert url_for('main.uploads', service_id=service_one['id']) not in page
|
||||
|
||||
|
||||
def test_menu_manage_service(
|
||||
mocker,
|
||||
app_,
|
||||
|
||||
5
tests/app/main/views/test_uploads.py
Normal file
5
tests/app/main/views/test_uploads.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from tests.conftest import SERVICE_ONE_ID
|
||||
|
||||
|
||||
def test_get_upload_hub_page(client_request):
|
||||
client_request.get('main.uploads', service_id=SERVICE_ONE_ID)
|
||||
Reference in New Issue
Block a user