mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-03 15:41:06 -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:
@@ -191,14 +191,23 @@ def test_should_show_empty_api_keys_page(
|
||||
def test_should_show_api_keys_page(
|
||||
client_request,
|
||||
mock_get_api_keys,
|
||||
fake_uuid,
|
||||
):
|
||||
page = client_request.get('main.api_keys', service_id=SERVICE_ONE_ID)
|
||||
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[1] == 'another key name Revoked 1 January at 1:00am'
|
||||
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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user