File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
app/templates/views/guidance/using-notify Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 1010{% block content_column_content %}
1111
1212 < h1 class ="heading-large "> Documentation</ h1 >
13+
14+ {% if current_user.platform_admin %}
15+ < a href ="{{ url_for( ".guidance_api_documentation_section ") }}"
16+ class="govuk-link govuk-link--no-visited-state "
17+ target ="_blank " rel ="noopener ">
18+ Send a link to docs section
19+ </ a >
20+ < p > </ p >
21+ {% endif %}
22+
1323 < p class ="govuk-body "> This documentation is for developers who want to integrate the GOV.UK Notify API with a web application or back office system.</ p >
1424 < h2 class ="heading-medium " id ="client-libraries "> Client libraries</ h2 >
1525 < p class ="govuk-body "> Links to documentation open in a new tab.</ p >
Original file line number Diff line number Diff line change @@ -386,6 +386,20 @@ def test_trial_mode_sending_limits(client_request):
386386 ]
387387
388388
389+ def test_guidance_api_documentation_links_to_section_flow_for_platform_admins (client_request , platform_admin_user ):
390+ client_request .login (platform_admin_user )
391+
392+ page = client_request .get ("main.guidance_api_documentation" )
393+
394+ assert len (page .select ('a[href^="{link}"]' .format (link = url_for (".guidance_api_documentation_section" )))) == 1
395+
396+
397+ def test_guidance_api_documentation_does_not_link_to_section_flow_for_non_platform_admins (client_request ):
398+ page = client_request .get ("main.guidance_api_documentation" )
399+
400+ assert len (page .select ('a[href^="{link}"]' .format (link = url_for (".guidance_api_documentation_section" )))) == 0
401+
402+
389403def test_GET_guidance_api_documentation_section (client_request ):
390404 page = client_request .get ("main.guidance_api_documentation_section" )
391405
You can’t perform that action at this time.
0 commit comments