Add descriptive links to API keys page

The links had no descriptive text, so all read 'Revoke'. This adds
hidden text specific to the item they relate to.
This commit is contained in:
Katie Smith
2021-02-23 14:53:33 +00:00
parent e7d6a2ea0d
commit 6512b8fad3
2 changed files with 4 additions and 2 deletions

View File

@@ -46,7 +46,9 @@
{% endcall %}
{% else %}
{% call field(align='right', status='error') %}
<a class="govuk-link govuk-link--no-visited-state" href='{{ url_for('.revoke_api_key', service_id=current_service.id, key_id=item.id) }}'>Revoke</a>
<a class="govuk-link govuk-link--no-visited-state" href='{{ url_for('.revoke_api_key', service_id=current_service.id, key_id=item.id) }}'>
Revoke<span class="govuk-visually-hidden"> {{ item.name }}</span>
</a>
{% endcall %}
{% endif %}
{% endcall %}

View File

@@ -197,7 +197,7 @@ def test_should_show_api_keys_page(
assert rows[0] == 'API keys Action'
assert rows[1] == 'another key name Revoked 1 January at 1:00am'
assert rows[2] == 'some key name Revoke'
assert rows[2] == 'some key name Revoke some key name'
mock_get_api_keys.assert_called_once_with(SERVICE_ONE_ID)