diff --git a/app/templates/views/guidance/using-notify/api-documentation.html b/app/templates/views/guidance/using-notify/api-documentation.html index 764be8d091f..c33789d2dfe 100644 --- a/app/templates/views/guidance/using-notify/api-documentation.html +++ b/app/templates/views/guidance/using-notify/api-documentation.html @@ -10,6 +10,16 @@ {% block content_column_content %}

Documentation

+ + {% if current_user.platform_admin %} + + Send a link to docs section + +

+ {% endif %} +

This documentation is for developers who want to integrate the GOV.UK Notify API with a web application or back office system.

Client libraries

Links to documentation open in a new tab.

diff --git a/tests/app/main/views/test_index.py b/tests/app/main/views/test_index.py index aa6833a4779..9bdcb1783de 100644 --- a/tests/app/main/views/test_index.py +++ b/tests/app/main/views/test_index.py @@ -386,6 +386,20 @@ def test_trial_mode_sending_limits(client_request): ] +def test_guidance_api_documentation_links_to_section_flow_for_platform_admins(client_request, platform_admin_user): + client_request.login(platform_admin_user) + + page = client_request.get("main.guidance_api_documentation") + + assert len(page.select('a[href^="{link}"]'.format(link=url_for(".guidance_api_documentation_section")))) == 1 + + +def test_guidance_api_documentation_does_not_link_to_section_flow_for_non_platform_admins(client_request): + page = client_request.get("main.guidance_api_documentation") + + assert len(page.select('a[href^="{link}"]'.format(link=url_for(".guidance_api_documentation_section")))) == 0 + + def test_GET_guidance_api_documentation_section(client_request): page = client_request.get("main.guidance_api_documentation_section")