Make deletion confirmation banner messages consistent across our app

Also introduce a way to provide context to a banner / flash message
that will be displayed in plain font style.
This commit is contained in:
Pea Tyczynska
2018-11-15 17:14:03 +00:00
parent 1dc63bbe63
commit a43e6a8885
8 changed files with 28 additions and 50 deletions

View File

@@ -310,7 +310,7 @@ def test_should_show_confirm_revoke_api_key(
assert normalize_spaces(page.select('.banner-dangerous')[0].text) == (
'Are you sure you want to revoke this API key? '
'some key name will no longer let you connect to GOV.UK Notify. '
'Confirm'
'Yes, revoke'
)
assert mock_get_api_keys.call_args_list == [
call(

View File

@@ -1281,7 +1281,7 @@ def test_should_show_delete_template_page_with_time_block(
template_id=fake_uuid,
_test_page_title=False,
)
assert page.h1.text == 'Are you sure you want to delete Two week reminder?'
assert "Are you sure you want to delete Two week reminder?" in page.select('.banner-dangerous')[0].text
assert normalize_spaces(page.select('.banner-dangerous p')[0].text) == (
'It was last used 10 minutes ago'
)
@@ -1310,7 +1310,7 @@ def test_should_show_delete_template_page_with_time_block_for_empty_notification
template_id=fake_uuid,
_test_page_title=False,
)
assert page.h1.text == 'Are you sure you want to delete Two week reminder?'
assert "Are you sure you want to delete Two week reminder?" in page.select('.banner-dangerous')[0].text
assert normalize_spaces(page.select('.banner-dangerous p')[0].text) == (
'It was last used more than seven days ago'
)
@@ -1336,7 +1336,7 @@ def test_should_show_delete_template_page_with_never_used_block(
template_id=fake_uuid,
_test_page_title=False,
)
assert page.h1.text == 'Are you sure you want to delete Two week reminder?'
assert "Are you sure you want to delete Two week reminder?" in page.select('.banner-dangerous')[0].text
assert not page.select('.banner-dangerous p')
assert normalize_spaces(page.select('.sms-message-wrapper')[0].text) == (
'service one: Template <em>content</em> with & entity'