mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-02 17:48:50 -04:00
Fix the ‘revoke’ links on the API keys page
They were missing the `govuk-link--destructive` class which turns them red, consistent with other links we use for deleting or suspending things.
This commit is contained in:
@@ -46,7 +46,7 @@
|
|||||||
{% endcall %}
|
{% endcall %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% call field(align='right', status='error') %}
|
{% 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) }}'>
|
<a class="govuk-link govuk-link--destructive" href='{{ url_for('.revoke_api_key', service_id=current_service.id, key_id=item.id) }}'>
|
||||||
Revoke<span class="govuk-visually-hidden"> {{ item.name }}</span>
|
Revoke<span class="govuk-visually-hidden"> {{ item.name }}</span>
|
||||||
</a>
|
</a>
|
||||||
{% endcall %}
|
{% endcall %}
|
||||||
|
|||||||
@@ -191,14 +191,23 @@ def test_should_show_empty_api_keys_page(
|
|||||||
def test_should_show_api_keys_page(
|
def test_should_show_api_keys_page(
|
||||||
client_request,
|
client_request,
|
||||||
mock_get_api_keys,
|
mock_get_api_keys,
|
||||||
|
fake_uuid,
|
||||||
):
|
):
|
||||||
page = client_request.get('main.api_keys', service_id=SERVICE_ONE_ID)
|
page = client_request.get('main.api_keys', service_id=SERVICE_ONE_ID)
|
||||||
rows = [normalize_spaces(row.text) for row in page.select('main tr')]
|
rows = [normalize_spaces(row.text) for row in page.select('main tr')]
|
||||||
|
revoke_link = page.select_one('main tr a.govuk-link.govuk-link--destructive')
|
||||||
|
|
||||||
assert rows[0] == 'API keys Action'
|
assert rows[0] == 'API keys Action'
|
||||||
assert rows[1] == 'another key name Revoked 1 January at 1:00am'
|
assert rows[1] == 'another key name Revoked 1 January at 1:00am'
|
||||||
assert rows[2] == 'some key name Revoke some key name'
|
assert rows[2] == 'some key name Revoke some key name'
|
||||||
|
|
||||||
|
assert normalize_spaces(revoke_link.text) == 'Revoke some key name'
|
||||||
|
assert revoke_link['href'] == url_for(
|
||||||
|
'main.revoke_api_key',
|
||||||
|
service_id=SERVICE_ONE_ID,
|
||||||
|
key_id=fake_uuid,
|
||||||
|
)
|
||||||
|
|
||||||
mock_get_api_keys.assert_called_once_with(SERVICE_ONE_ID)
|
mock_get_api_keys.assert_called_once_with(SERVICE_ONE_ID)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user