mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-26 05:11:06 -05:00
Merge pull request #4236 from alphagov/fix-whitespace-copy
Remove whitespace from copy to clipboard component
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
{% endif %}
|
||||
<div data-module="copy-to-clipboard" data-value="{{ value }}" data-thing="{{ thing }}" data-name="{{ name }}">
|
||||
<span class="copy-to-clipboard__value">
|
||||
{% if name|lower != thing|lower %}<span class="govuk-visually-hidden">{{ thing }}: </span>{% endif %}{{ value }}
|
||||
{%- if name|lower != thing|lower %}<span class="govuk-visually-hidden">{{ thing }}: </span>{% endif %}{{ value -}}
|
||||
</span>
|
||||
<span class="copy-to-clipboard__notice" aria-live="assertive"></span>
|
||||
</div>
|
||||
|
||||
@@ -281,8 +281,9 @@ def test_should_create_api_key_with_type_normal(
|
||||
_expected_status=200,
|
||||
)
|
||||
|
||||
assert page.select_one('span.copy-to-clipboard__value').text.strip() == (
|
||||
'some_default_key_name_12-{}-{}'.format(SERVICE_ONE_ID, fake_uuid)
|
||||
assert page.select_one('span.copy-to-clipboard__value').text == (
|
||||
# The text should be exactly this, with no leading or trailing whitespace
|
||||
f'some_default_key_name_12-{SERVICE_ONE_ID}-{fake_uuid}'
|
||||
)
|
||||
|
||||
post.assert_called_once_with(url='/service/{}/api-key'.format(SERVICE_ONE_ID), data={
|
||||
|
||||
Reference in New Issue
Block a user