2018-04-24 12:48:05 +01:00
|
|
|
import pytest
|
2019-12-10 14:01:47 +00:00
|
|
|
from flask import Flask
|
2018-04-24 12:48:05 +01:00
|
|
|
|
2019-12-10 14:01:47 +00:00
|
|
|
from app import create_app
|
2018-06-12 16:17:20 +01:00
|
|
|
from app.navigation import (
|
|
|
|
|
CaseworkNavigation,
|
|
|
|
|
HeaderNavigation,
|
|
|
|
|
MainNavigation,
|
2021-02-26 18:19:47 +00:00
|
|
|
Navigation,
|
2018-06-12 16:17:20 +01:00
|
|
|
OrgNavigation,
|
|
|
|
|
)
|
2023-06-08 13:12:00 -04:00
|
|
|
# from tests.conftest import ORGANISATION_ID, SERVICE_ONE_ID, normalize_spaces
|
|
|
|
|
from tests.conftest import SERVICE_ONE_ID, normalize_spaces
|
2018-04-24 12:48:05 +01:00
|
|
|
|
2021-02-26 18:19:47 +00:00
|
|
|
EXCLUDED_ENDPOINTS = tuple(map(Navigation.get_endpoint_with_blueprint, {
|
|
|
|
|
'accept_invite',
|
|
|
|
|
'accept_org_invite',
|
|
|
|
|
'accessibility_statement',
|
|
|
|
|
'action_blocked',
|
|
|
|
|
'add_data_retention',
|
2023-07-12 12:09:44 -04:00
|
|
|
'add_organization',
|
2021-02-26 18:19:47 +00:00
|
|
|
'add_service',
|
|
|
|
|
'add_service_template',
|
|
|
|
|
'api_callbacks',
|
|
|
|
|
'api_documentation',
|
|
|
|
|
'api_integration',
|
|
|
|
|
'api_keys',
|
|
|
|
|
'archive_service',
|
|
|
|
|
'archive_user',
|
|
|
|
|
'bat_phone',
|
|
|
|
|
'begin_tour',
|
2021-08-27 11:44:19 +01:00
|
|
|
'billing_details',
|
2021-02-26 18:19:47 +00:00
|
|
|
'branding_and_customisation',
|
|
|
|
|
'callbacks',
|
|
|
|
|
'cancel_invited_org_user',
|
|
|
|
|
'cancel_invited_user',
|
|
|
|
|
'cancel_job',
|
2022-02-23 19:57:27 +00:00
|
|
|
'change_user_auth',
|
2021-02-26 18:19:47 +00:00
|
|
|
'check_and_resend_text_code',
|
|
|
|
|
'check_and_resend_verification_code',
|
|
|
|
|
'check_messages',
|
|
|
|
|
'check_notification',
|
|
|
|
|
'check_tour_notification',
|
|
|
|
|
'choose_account',
|
|
|
|
|
'choose_service',
|
|
|
|
|
'choose_template',
|
|
|
|
|
'choose_template_to_copy',
|
|
|
|
|
'clear_cache',
|
|
|
|
|
'confirm_edit_user_email',
|
|
|
|
|
'confirm_edit_user_mobile_number',
|
|
|
|
|
'confirm_redact_template',
|
|
|
|
|
'conversation',
|
|
|
|
|
'conversation_reply',
|
|
|
|
|
'conversation_reply_with_template',
|
|
|
|
|
'conversation_updates',
|
|
|
|
|
'copy_template',
|
|
|
|
|
'count_content_length',
|
|
|
|
|
'create_and_send_messages',
|
|
|
|
|
'create_api_key',
|
|
|
|
|
'create_email_branding',
|
|
|
|
|
'data_retention',
|
|
|
|
|
'delete_service_template',
|
|
|
|
|
'delete_template_folder',
|
|
|
|
|
'delivery_and_failure',
|
|
|
|
|
'delivery_status_callback',
|
|
|
|
|
'design_content',
|
|
|
|
|
'documentation',
|
|
|
|
|
'download_notifications_csv',
|
2023-07-12 12:09:44 -04:00
|
|
|
'download_organization_usage_report',
|
2021-02-26 18:19:47 +00:00
|
|
|
'edit_and_format_messages',
|
|
|
|
|
'edit_data_retention',
|
2023-07-12 12:09:44 -04:00
|
|
|
'edit_organization_billing_details',
|
|
|
|
|
'edit_organization_domains',
|
|
|
|
|
'edit_organization_email_branding',
|
|
|
|
|
'edit_organization_go_live_notes',
|
|
|
|
|
'edit_organization_name',
|
|
|
|
|
'edit_organization_notes',
|
|
|
|
|
'edit_organization_type',
|
|
|
|
|
'edit_organization_user',
|
2021-02-26 18:19:47 +00:00
|
|
|
'edit_service_billing_details',
|
|
|
|
|
'edit_service_notes',
|
|
|
|
|
'edit_service_template',
|
|
|
|
|
'edit_sms_provider_ratio',
|
|
|
|
|
'edit_user_email',
|
|
|
|
|
'edit_user_mobile_number',
|
|
|
|
|
'edit_user_permissions',
|
|
|
|
|
'email_branding',
|
2022-01-28 09:45:59 +00:00
|
|
|
'email_branding_govuk',
|
2022-02-03 11:31:25 +00:00
|
|
|
'email_branding_govuk_and_org',
|
2023-07-12 12:09:44 -04:00
|
|
|
'email_branding_organization',
|
2022-01-19 15:39:05 +00:00
|
|
|
'email_branding_request',
|
2022-01-28 09:45:59 +00:00
|
|
|
'email_branding_something_else',
|
2021-02-26 18:19:47 +00:00
|
|
|
'email_not_received',
|
|
|
|
|
'email_template',
|
|
|
|
|
'error',
|
|
|
|
|
'estimate_usage',
|
|
|
|
|
'features',
|
|
|
|
|
'features_email',
|
|
|
|
|
'features_sms',
|
|
|
|
|
'feedback',
|
|
|
|
|
'find_services_by_name',
|
|
|
|
|
'find_users_by_email',
|
|
|
|
|
'forgot_password',
|
2021-03-30 15:16:02 +01:00
|
|
|
'get_billing_report',
|
2023-07-26 09:08:55 -07:00
|
|
|
'get_users_report',
|
2022-03-07 14:30:11 +00:00
|
|
|
'get_daily_volumes',
|
2022-04-08 16:05:43 +01:00
|
|
|
'get_daily_sms_provider_volumes',
|
2022-03-07 14:30:11 +00:00
|
|
|
'get_volumes_by_service',
|
2021-02-26 18:19:47 +00:00
|
|
|
'get_example_csv',
|
|
|
|
|
'get_notifications_as_json',
|
|
|
|
|
'get_started',
|
|
|
|
|
'get_started_old',
|
|
|
|
|
'go_to_dashboard_after_tour',
|
|
|
|
|
'guest_list',
|
|
|
|
|
'guidance_index',
|
|
|
|
|
'history',
|
|
|
|
|
'how_to_pay',
|
|
|
|
|
'inbound_sms_admin',
|
|
|
|
|
'inbox',
|
|
|
|
|
'inbox_download',
|
|
|
|
|
'inbox_updates',
|
|
|
|
|
'index',
|
|
|
|
|
'information_risk_management',
|
|
|
|
|
'information_security',
|
|
|
|
|
'integration_testing',
|
|
|
|
|
'invite_org_user',
|
|
|
|
|
'invite_user',
|
2023-07-12 12:09:44 -04:00
|
|
|
'link_service_to_organization',
|
2021-02-26 18:19:47 +00:00
|
|
|
'live_services',
|
|
|
|
|
'live_services_csv',
|
|
|
|
|
'manage_org_users',
|
|
|
|
|
'manage_template_folder',
|
|
|
|
|
'manage_users',
|
|
|
|
|
'message_status',
|
|
|
|
|
'monthly',
|
|
|
|
|
'new_password',
|
|
|
|
|
'notifications_sent_by_service',
|
|
|
|
|
'old_guest_list',
|
|
|
|
|
'old_integration_testing',
|
|
|
|
|
'old_roadmap',
|
|
|
|
|
'old_service_dashboard',
|
|
|
|
|
'old_terms',
|
|
|
|
|
'old_using_notify',
|
2023-07-12 12:09:44 -04:00
|
|
|
'organization_billing',
|
|
|
|
|
'organization_dashboard',
|
|
|
|
|
'organization_preview_email_branding',
|
|
|
|
|
'organization_settings',
|
|
|
|
|
'organization_trial_mode_services',
|
|
|
|
|
'organizations',
|
2021-02-26 18:19:47 +00:00
|
|
|
'performance',
|
|
|
|
|
'platform_admin',
|
|
|
|
|
'platform_admin_list_complaints',
|
|
|
|
|
'platform_admin_reports',
|
|
|
|
|
'platform_admin_splash_page',
|
|
|
|
|
'pricing',
|
|
|
|
|
'privacy',
|
|
|
|
|
'received_text_messages_callback',
|
|
|
|
|
'redact_template',
|
|
|
|
|
'register',
|
|
|
|
|
'register_from_invite',
|
|
|
|
|
'register_from_org_invite',
|
|
|
|
|
'registration_continue',
|
2023-07-12 12:09:44 -04:00
|
|
|
'remove_user_from_organization',
|
2021-02-26 18:19:47 +00:00
|
|
|
'remove_user_from_service',
|
|
|
|
|
'request_to_go_live',
|
|
|
|
|
'resend_email_link',
|
|
|
|
|
'resend_email_verification',
|
|
|
|
|
'resume_service',
|
|
|
|
|
'revalidate_email_sent',
|
|
|
|
|
'revoke_api_key',
|
|
|
|
|
'roadmap',
|
|
|
|
|
'security',
|
2021-12-06 15:59:13 +00:00
|
|
|
'security_policy',
|
2021-02-26 18:19:47 +00:00
|
|
|
'send_files_by_email',
|
|
|
|
|
'send_files_by_email_contact_details',
|
|
|
|
|
'send_messages',
|
|
|
|
|
'send_notification',
|
|
|
|
|
'send_one_off',
|
|
|
|
|
'send_one_off_step',
|
|
|
|
|
'send_one_off_to_myself',
|
|
|
|
|
'service_add_email_reply_to',
|
|
|
|
|
'service_add_sms_sender',
|
|
|
|
|
'service_confirm_delete_email_reply_to',
|
|
|
|
|
'service_confirm_delete_sms_sender',
|
|
|
|
|
'service_dashboard',
|
|
|
|
|
'service_dashboard_updates',
|
|
|
|
|
'service_delete_email_reply_to',
|
|
|
|
|
'service_delete_sms_sender',
|
|
|
|
|
'service_edit_email_reply_to',
|
|
|
|
|
'service_edit_sms_sender',
|
|
|
|
|
'service_email_reply_to',
|
|
|
|
|
'service_name_change',
|
|
|
|
|
'service_preview_email_branding',
|
|
|
|
|
'service_set_auth_type',
|
|
|
|
|
'service_set_channel',
|
|
|
|
|
'service_set_email_branding',
|
|
|
|
|
'service_set_inbound_number',
|
|
|
|
|
'service_set_inbound_sms',
|
|
|
|
|
'service_set_international_sms',
|
|
|
|
|
'service_set_permission',
|
|
|
|
|
'service_set_reply_to_email',
|
|
|
|
|
'service_set_sms_prefix',
|
|
|
|
|
'service_settings',
|
|
|
|
|
'service_sms_senders',
|
|
|
|
|
'service_switch_count_as_live',
|
|
|
|
|
'service_switch_live',
|
|
|
|
|
'service_verify_reply_to_address',
|
|
|
|
|
'service_verify_reply_to_address_updates',
|
|
|
|
|
'services_or_dashboard',
|
|
|
|
|
'set_free_sms_allowance',
|
|
|
|
|
'set_message_limit',
|
|
|
|
|
'set_rate_limit',
|
|
|
|
|
'set_sender',
|
|
|
|
|
'set_template_sender',
|
|
|
|
|
'show_accounts_or_dashboard',
|
|
|
|
|
'sign_in',
|
|
|
|
|
'sign_out',
|
|
|
|
|
'start_job',
|
|
|
|
|
'submit_request_to_go_live',
|
|
|
|
|
'support',
|
|
|
|
|
'support_public',
|
|
|
|
|
'suspend_service',
|
|
|
|
|
'template_history',
|
|
|
|
|
'template_usage',
|
|
|
|
|
'terms',
|
|
|
|
|
'thanks',
|
|
|
|
|
'tour_step',
|
|
|
|
|
'triage',
|
|
|
|
|
'trial_mode',
|
|
|
|
|
'trial_mode_new',
|
|
|
|
|
'trial_services',
|
2021-05-14 19:15:12 +01:00
|
|
|
'two_factor_sms',
|
2021-02-26 18:19:47 +00:00
|
|
|
'two_factor_email',
|
|
|
|
|
'two_factor_email_interstitial',
|
|
|
|
|
'two_factor_email_sent',
|
|
|
|
|
'update_email_branding',
|
|
|
|
|
'uploads',
|
|
|
|
|
'usage',
|
|
|
|
|
'user_information',
|
|
|
|
|
'user_profile',
|
2022-03-18 13:08:09 +00:00
|
|
|
'user_profile_confirm_delete_mobile_number',
|
2021-02-26 18:19:47 +00:00
|
|
|
'user_profile_disable_platform_admin_view',
|
|
|
|
|
'user_profile_email',
|
|
|
|
|
'user_profile_email_authenticate',
|
|
|
|
|
'user_profile_email_confirm',
|
|
|
|
|
'user_profile_mobile_number',
|
|
|
|
|
'user_profile_mobile_number_authenticate',
|
|
|
|
|
'user_profile_mobile_number_confirm',
|
2022-03-18 13:08:09 +00:00
|
|
|
'user_profile_mobile_number_delete',
|
2021-02-26 18:19:47 +00:00
|
|
|
'user_profile_name',
|
|
|
|
|
'user_profile_password',
|
|
|
|
|
'using_notify',
|
|
|
|
|
'verify',
|
|
|
|
|
'verify_email',
|
|
|
|
|
'view_job',
|
|
|
|
|
'view_job_csv',
|
|
|
|
|
'view_job_updates',
|
|
|
|
|
'view_jobs',
|
|
|
|
|
'view_notification',
|
|
|
|
|
'view_notification_updates',
|
|
|
|
|
'view_notifications',
|
|
|
|
|
'view_notifications_csv',
|
|
|
|
|
'view_provider',
|
|
|
|
|
'view_providers',
|
|
|
|
|
'view_template',
|
|
|
|
|
'view_template_version',
|
|
|
|
|
'view_template_versions',
|
|
|
|
|
'who_its_for',
|
|
|
|
|
}))
|
|
|
|
|
|
2019-12-10 14:01:47 +00:00
|
|
|
|
|
|
|
|
def flask_app():
|
|
|
|
|
app = Flask('app')
|
|
|
|
|
create_app(app)
|
|
|
|
|
|
|
|
|
|
ctx = app.app_context()
|
|
|
|
|
ctx.push()
|
|
|
|
|
|
|
|
|
|
yield app
|
|
|
|
|
|
|
|
|
|
|
2018-04-24 12:48:05 +01:00
|
|
|
all_endpoints = [
|
2019-12-10 14:01:47 +00:00
|
|
|
rule.endpoint for rule in next(flask_app()).url_map.iter_rules()
|
2018-04-24 12:48:05 +01:00
|
|
|
]
|
|
|
|
|
|
2018-06-12 16:17:20 +01:00
|
|
|
navigation_instances = (
|
2018-04-25 11:11:37 +01:00
|
|
|
MainNavigation(),
|
|
|
|
|
HeaderNavigation(),
|
2018-04-25 13:17:47 +01:00
|
|
|
OrgNavigation(),
|
2018-06-12 16:17:20 +01:00
|
|
|
CaseworkNavigation(),
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
2021-08-27 11:44:19 +01:00
|
|
|
@pytest.mark.parametrize(
|
|
|
|
|
'navigation_instance',
|
|
|
|
|
navigation_instances,
|
|
|
|
|
ids=(x.__class__.__name__ for x in navigation_instances)
|
|
|
|
|
)
|
2018-04-25 11:11:37 +01:00
|
|
|
def test_navigation_items_are_properly_defined(navigation_instance):
|
|
|
|
|
for endpoint in navigation_instance.endpoints_with_navigation:
|
|
|
|
|
assert (
|
|
|
|
|
endpoint in all_endpoints
|
|
|
|
|
), '{} is not a real endpoint (in {}.mapping)'.format(
|
|
|
|
|
endpoint,
|
|
|
|
|
type(navigation_instance).__name__
|
|
|
|
|
)
|
|
|
|
|
assert (
|
|
|
|
|
navigation_instance.endpoints_with_navigation.count(endpoint) == 1
|
|
|
|
|
), '{} found more than once in {}.mapping'.format(
|
|
|
|
|
endpoint,
|
|
|
|
|
type(navigation_instance).__name__
|
|
|
|
|
)
|
2018-04-24 12:48:05 +01:00
|
|
|
|
|
|
|
|
|
2021-02-26 18:19:47 +00:00
|
|
|
def test_excluded_navigation_items_are_properly_defined():
|
|
|
|
|
for endpoint in EXCLUDED_ENDPOINTS:
|
2018-04-25 11:11:37 +01:00
|
|
|
assert (
|
|
|
|
|
endpoint in all_endpoints
|
2021-02-26 18:19:47 +00:00
|
|
|
), f'{endpoint} is not a real endpoint (in EXCLUDED_ENDPOINTS)'
|
|
|
|
|
|
2018-04-25 11:11:37 +01:00
|
|
|
assert (
|
2021-02-26 18:19:47 +00:00
|
|
|
EXCLUDED_ENDPOINTS.count(endpoint) == 1
|
|
|
|
|
), f'{endpoint} found more than once in EXCLUDED_ENDPOINTS'
|
2018-04-24 12:48:05 +01:00
|
|
|
|
|
|
|
|
|
2021-08-27 11:44:19 +01:00
|
|
|
@pytest.mark.parametrize(
|
|
|
|
|
'navigation_instance',
|
|
|
|
|
navigation_instances,
|
|
|
|
|
ids=(x.__class__.__name__ for x in navigation_instances)
|
|
|
|
|
)
|
2018-04-25 11:11:37 +01:00
|
|
|
def test_all_endpoints_are_covered(navigation_instance):
|
2021-02-26 18:19:47 +00:00
|
|
|
covered_endpoints = (
|
|
|
|
|
navigation_instance.endpoints_with_navigation +
|
|
|
|
|
EXCLUDED_ENDPOINTS +
|
2022-09-07 21:32:33 -07:00
|
|
|
('static', 'status.show_status', 'status.show_redis_status', 'metrics')
|
2021-02-26 18:19:47 +00:00
|
|
|
)
|
|
|
|
|
|
2018-04-24 12:48:05 +01:00
|
|
|
for endpoint in all_endpoints:
|
2021-02-26 18:19:47 +00:00
|
|
|
assert endpoint in covered_endpoints, f'{endpoint} is not listed or excluded'
|
2018-04-24 12:48:05 +01:00
|
|
|
|
|
|
|
|
|
2021-08-27 11:44:19 +01:00
|
|
|
@pytest.mark.parametrize(
|
|
|
|
|
'navigation_instance',
|
|
|
|
|
navigation_instances,
|
|
|
|
|
ids=(x.__class__.__name__ for x in navigation_instances)
|
|
|
|
|
)
|
2018-04-25 11:11:37 +01:00
|
|
|
def test_raises_on_invalid_navigation_item(
|
|
|
|
|
client_request, navigation_instance
|
|
|
|
|
):
|
2023-05-26 12:35:48 -07:00
|
|
|
with pytest.raises(expected_exception=KeyError):
|
|
|
|
|
navigation_instance.is_selected('foo')
|
2018-04-24 12:48:05 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.parametrize('endpoint, selected_nav_item', [
|
2022-08-05 00:25:03 -07:00
|
|
|
('main.choose_template', 'Send messages'),
|
2018-04-24 12:48:05 +01:00
|
|
|
('main.manage_users', 'Team members'),
|
|
|
|
|
])
|
|
|
|
|
def test_a_page_should_nave_selected_navigation_item(
|
|
|
|
|
client_request,
|
|
|
|
|
mock_get_service_templates,
|
|
|
|
|
mock_get_users_by_service,
|
|
|
|
|
mock_get_invites_for_service,
|
2018-11-01 17:11:58 +00:00
|
|
|
mock_get_template_folders,
|
2021-04-13 13:59:51 +01:00
|
|
|
mock_get_api_keys,
|
2018-04-24 12:48:05 +01:00
|
|
|
endpoint,
|
|
|
|
|
selected_nav_item,
|
|
|
|
|
):
|
|
|
|
|
page = client_request.get(endpoint, service_id=SERVICE_ONE_ID)
|
2023-06-08 13:12:00 -04:00
|
|
|
selected_nav_items = page.select('nav.nav li.usa-sidenav__item a.usa-current')
|
2018-04-24 12:48:05 +01:00
|
|
|
assert len(selected_nav_items) == 1
|
|
|
|
|
assert selected_nav_items[0].text.strip() == selected_nav_item
|
2018-04-25 11:11:37 +01:00
|
|
|
|
2023-07-06 10:33:27 -04:00
|
|
|
# Hiding nav for the pilot, will uncomment after
|
2018-04-25 11:11:37 +01:00
|
|
|
|
2023-07-06 10:33:27 -04:00
|
|
|
# @pytest.mark.parametrize('endpoint, selected_nav_item', [
|
|
|
|
|
# # ('main.documentation', 'Documentation'),
|
|
|
|
|
# ('main.support', 'Contact us'),
|
|
|
|
|
# ])
|
|
|
|
|
# def test_a_page_should_nave_selected_header_navigation_item(
|
|
|
|
|
# client_request,
|
|
|
|
|
# endpoint,
|
|
|
|
|
# selected_nav_item,
|
|
|
|
|
# ):
|
|
|
|
|
# page = client_request.get(endpoint, service_id=SERVICE_ONE_ID)
|
|
|
|
|
# selected_nav_items = page.select('nav.usa-nav a.usa-nav__link.usa-current')
|
|
|
|
|
# assert len(selected_nav_items) == 1
|
|
|
|
|
# assert selected_nav_items[0].text.strip() == selected_nav_item
|
2018-04-25 13:17:47 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.parametrize('endpoint, selected_nav_item', [
|
2023-07-12 12:09:44 -04:00
|
|
|
('main.organization_dashboard', 'Usage'),
|
2018-04-25 13:17:47 +01:00
|
|
|
('main.manage_org_users', 'Team members'),
|
|
|
|
|
])
|
|
|
|
|
def test_a_page_should_nave_selected_org_navigation_item(
|
|
|
|
|
client_request,
|
2023-07-12 12:09:44 -04:00
|
|
|
mock_get_organization,
|
|
|
|
|
mock_get_users_for_organization,
|
|
|
|
|
mock_get_invited_users_for_organization,
|
2018-04-25 13:17:47 +01:00
|
|
|
endpoint,
|
|
|
|
|
selected_nav_item,
|
2020-02-25 17:49:55 +00:00
|
|
|
mocker
|
2018-04-25 13:17:47 +01:00
|
|
|
):
|
2020-02-25 17:49:55 +00:00
|
|
|
mocker.patch(
|
2023-07-12 12:09:44 -04:00
|
|
|
'app.organizations_client.get_services_and_usage', return_value={'services': {}}
|
2020-02-25 17:49:55 +00:00
|
|
|
)
|
2023-06-08 13:12:00 -04:00
|
|
|
# page = client_request.get(endpoint, org_id=ORGANISATION_ID)
|
|
|
|
|
# selected_nav_item_element = page.select_one('.usa-sidenav a.usa-current')
|
|
|
|
|
# assert selected_nav_item_element is not None
|
|
|
|
|
# assert selected_nav_item_element.text.strip() == selected_nav_item
|
2018-06-12 16:17:20 +01:00
|
|
|
|
|
|
|
|
|
2019-11-13 15:10:16 +00:00
|
|
|
def test_navigation_urls(
|
|
|
|
|
client_request,
|
|
|
|
|
mock_get_service_templates,
|
|
|
|
|
mock_get_template_folders,
|
2021-04-13 13:59:51 +01:00
|
|
|
mock_get_api_keys,
|
2019-11-13 15:10:16 +00:00
|
|
|
):
|
|
|
|
|
page = client_request.get('main.choose_template', service_id=SERVICE_ONE_ID)
|
|
|
|
|
assert [
|
2023-08-15 13:22:39 -04:00
|
|
|
a['href'] for a in page.select('.nav.margin-bottom-5 a')
|
2019-11-13 15:10:16 +00:00
|
|
|
] == [
|
|
|
|
|
'/services/{}'.format(SERVICE_ONE_ID),
|
|
|
|
|
'/services/{}/templates'.format(SERVICE_ONE_ID),
|
|
|
|
|
'/services/{}/users'.format(SERVICE_ONE_ID),
|
|
|
|
|
'/services/{}/usage'.format(SERVICE_ONE_ID),
|
|
|
|
|
'/services/{}/service-settings'.format(SERVICE_ONE_ID),
|
2022-12-02 10:30:37 -05:00
|
|
|
# '/services/{}/api'.format(SERVICE_ONE_ID),
|
2019-11-13 15:10:16 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
2018-06-12 16:17:20 +01:00
|
|
|
def test_caseworkers_get_caseworking_navigation(
|
|
|
|
|
client_request,
|
2018-11-01 17:11:58 +00:00
|
|
|
mock_get_template_folders,
|
2018-06-12 16:17:20 +01:00
|
|
|
mock_get_service_templates,
|
2018-07-30 17:40:32 +01:00
|
|
|
mock_has_no_jobs,
|
2021-04-13 13:59:51 +01:00
|
|
|
mock_get_api_keys,
|
2019-12-19 16:59:07 +00:00
|
|
|
active_caseworking_user,
|
2018-06-12 16:17:20 +01:00
|
|
|
):
|
2023-01-19 17:29:21 -05:00
|
|
|
client_request.login(active_caseworking_user)
|
2018-06-12 16:17:20 +01:00
|
|
|
page = client_request.get('main.choose_template', service_id=SERVICE_ONE_ID)
|
2023-06-08 13:12:00 -04:00
|
|
|
assert normalize_spaces(page.select_one('header + .grid-container nav').text) == (
|
2022-10-13 20:51:45 +00:00
|
|
|
'Send messages Sent messages Team members'
|
2018-06-12 16:17:20 +01:00
|
|
|
)
|
2018-07-30 17:40:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_caseworkers_see_jobs_nav_if_jobs_exist(
|
|
|
|
|
client_request,
|
|
|
|
|
mock_get_service_templates,
|
2018-11-01 17:11:58 +00:00
|
|
|
mock_get_template_folders,
|
2018-07-30 17:40:32 +01:00
|
|
|
mock_has_jobs,
|
2019-12-19 16:59:07 +00:00
|
|
|
active_caseworking_user,
|
2021-04-13 13:59:51 +01:00
|
|
|
mock_get_api_keys,
|
2018-07-30 17:40:32 +01:00
|
|
|
):
|
2023-01-19 17:29:21 -05:00
|
|
|
client_request.login(active_caseworking_user)
|
2018-07-30 17:40:32 +01:00
|
|
|
page = client_request.get('main.choose_template', service_id=SERVICE_ONE_ID)
|
2023-06-08 13:12:00 -04:00
|
|
|
assert normalize_spaces(page.select_one('header + .grid-container nav').text) == (
|
2022-10-13 20:51:45 +00:00
|
|
|
'Send messages Sent messages Team members'
|
2018-07-30 17:40:32 +01:00
|
|
|
)
|