Addressing most of the low-lift items from the Notify content audit (#491)

This commit is contained in:
Jonathan Bobel
2023-05-08 10:49:30 -04:00
committed by GitHub
parent 8f76a9bb17
commit 68e94dd650
32 changed files with 441 additions and 231 deletions

View File

@@ -56,38 +56,34 @@ def mock_get_service_settings_page_common(
'Label Value Action',
'Service name Test Service Change service name',
'Sign-in method Text message code Change sign-in method',
'Send text messages On Change your settings for sending text messages',
'Text message senders GOVUK Manage text message senders',
'Start text messages with service name On Change your settings for starting text messages with service name',
'Send international text messages Off Change your settings for sending international text messages',
# 'Label Value Action',
# 'Send emails On Change your settings for sending emails',
# 'Reply-to email addresses Not set Manage reply-to email addresses',
# 'Email branding GOV.UK Change email branding',
# 'Send files by email contact_us@gsa.gov Manage sending files by email',
'Label Value Action',
'Send text messages On Change your settings for sending text messages',
'Text message senders GOVUK Manage text message senders',
'Start text messages with service name On Change your settings for starting text messages with service name',
'Send international text messages Off Change your settings for sending international text messages',
'Receive text messages Off Change your settings for receiving text messages',
# 'Receive text messages Off Change your settings for receiving text messages',
]),
(create_platform_admin_user(), [
'Label Value Action',
'Service name Test Service Change service name',
'Sign-in method Text message code Change sign-in method',
'Send text messages On Change your settings for sending text messages',
'Text message senders GOVUK Manage text message senders',
'Start text messages with service name On Change your settings for starting text messages with service name',
'Send international text messages Off Change your settings for sending international text messages',
# 'Label Value Action',
# 'Send emails On Change your settings for sending emails',
# 'Reply-to email addresses Not set Manage reply-to email addresses',
# 'Email branding GOV.UK Change email branding',
# 'Send files by email contact_us@gsa.gov Manage sending files by email',
'Label Value Action',
'Send text messages On Change your settings for sending text messages',
'Text message senders GOVUK Manage text message senders',
'Start text messages with service name On Change your settings for starting text messages with service name',
'Send international text messages Off Change your settings for sending international text messages',
'Receive text messages Off Change your settings for receiving text messages',
# 'Receive text messages Off Change your settings for receiving text messages',
'Label Value Action',
'Live Off Change service status',
@@ -216,42 +212,38 @@ def test_send_files_by_email_row_on_settings_page(
@pytest.mark.parametrize('permissions, expected_rows', [
(['email', 'sms', 'inbound_sms', 'international_sms'], [
(['email', 'sms', 'international_sms'], [
'Service name service one Change service name',
'Sign-in method Text message code Change sign-in method',
'Send text messages On Change your settings for sending text messages',
'Text message senders GOVUK Manage text message senders',
'Start text messages with service name On Change your settings for starting text messages with service name',
'Send international text messages On Change your settings for sending international text messages',
# 'Label Value Action',
# 'Send emails On Change your settings for sending emails',
# 'Reply-to email addresses test@example.com Manage reply-to email addresses',
# 'Email branding Organisation name Change email branding',
# 'Send files by email Not set up Manage sending files by email',
'Label Value Action',
'Send text messages On Change your settings for sending text messages',
'Text message senders GOVUK Manage text message senders',
'Start text messages with service name On Change your settings for starting text messages with service name',
'Send international text messages On Change your settings for sending international text messages',
'Receive text messages On Change your settings for receiving text messages',
# 'Receive text messages On Change your settings for receiving text messages',
]),
(['email', 'sms', 'email_auth'], [
'Service name service one Change service name',
'Sign-in method Email link or text message code Change sign-in method',
'Send text messages On Change your settings for sending text messages',
'Text message senders GOVUK Manage text message senders',
'Start text messages with service name On Change your settings for starting text messages with service name',
'Send international text messages Off Change your settings for sending international text messages',
# 'Label Value Action',
# 'Send emails On Change your settings for sending emails',
# 'Reply-to email addresses test@example.com Manage reply-to email addresses',
# 'Email branding Organisation name Change email branding',
# 'Send files by email Not set up Manage sending files by email',
'Label Value Action',
'Send text messages On Change your settings for sending text messages',
'Text message senders GOVUK Manage text message senders',
'Start text messages with service name On Change your settings for starting text messages with service name',
'Send international text messages Off Change your settings for sending international text messages',
'Receive text messages Off Change your settings for receiving text messages',
# 'Send files by email Not set up Manage sending files by email'
# 'Receive text messages Off Change your settings for receiving text messages',
]),
])
@@ -3538,20 +3530,20 @@ def test_send_files_by_email_contact_details_does_not_update_invalid_contact_det
@pytest.mark.parametrize('endpoint, permissions, expected_p', [
(
'main.service_set_inbound_sms',
['sms'],
(
'Contact us if you want to be able to receive text messages from your users.'
)
),
(
'main.service_set_inbound_sms',
['sms', 'inbound_sms'],
(
'Your service can receive text messages sent to 2028675301.'
)
),
# (
# 'main.service_set_inbound_sms',
# ['sms'],
# (
# 'Contact us if you want to be able to receive text messages from your users.'
# )
# ),
# (
# 'main.service_set_inbound_sms',
# ['sms', 'inbound_sms'],
# (
# 'Your service can receive text messages sent to 2028675301.'
# )
# ),
(
'main.service_set_auth_type',
[],

View File

@@ -142,7 +142,7 @@ def test_should_add_service_and_redirect_to_tour_when_no_services(
'sms',
(
"Hi, Im trying out U.S. Notify. Today is "
"((day of week)) and my favourite color is ((color))."
"((day of week)) and my favorite color is ((color))."
),
101,
)

View File

@@ -458,7 +458,7 @@ def test_should_show_recent_templates_on_dashboard(
mock_template_stats.assert_called_once_with(SERVICE_ONE_ID, limit_days=7)
headers = [header.text.strip() for header in page.find_all('h2') + page.find_all('h1')]
assert 'In the last 7 days' in headers
assert 'In the last seven days' in headers
table_rows = page.find_all('tbody')[0].find_all('tr')

View File

@@ -16,7 +16,7 @@ def test_non_logged_in_user_can_see_homepage(
page = client_request.get('main.index', _test_page_title=False)
assert page.h1.text.strip() == (
'Send text messages and email to your users'
'Send text messages to your users'
)
assert page.select_one('a[role=button][draggable=false]')['href'] == url_for(
@@ -24,8 +24,8 @@ def test_non_logged_in_user_can_see_homepage(
)
assert page.select_one('meta[name=description]')['content'].strip() == (
'U.S. Notify lets you send text messages and email '
'to your users. Try it now if you work in federal, state or local government.'
'U.S. Notify lets you send text messages '
'to your users. Try it now if you work in federal, state, or local government.'
)
assert normalize_spaces(page.select_one('#whos-using-notify').text) == (

View File

@@ -21,7 +21,7 @@ def test_render_sign_in_template_for_new_user(
assert page.select_one('#password')['autocomplete'] == 'current-password'
assert page.select('main a')[0].text == 'create one now'
assert page.select('main a')[0]['href'] == url_for('main.register')
assert page.select('main a')[1].text == 'Forgotten your password?'
assert page.select('main a')[1].text == 'Forgot your password?'
assert page.select('main a')[1]['href'] == url_for('main.forgot_password')
assert 'Sign in again' not in normalize_spaces(page.text)
@@ -36,7 +36,7 @@ def test_render_sign_in_template_with_next_link_for_password_reset(
_test_page_title=False
)
forgot_password_link = page.find('a', class_="govuk-link govuk-link--no-visited-state page-footer-secondary-link")
assert forgot_password_link.text == 'Forgotten your password?'
assert forgot_password_link.text == 'Forgot your password?'
assert forgot_password_link['href'] == url_for('main.forgot_password', next=f'/services/{SERVICE_ONE_ID}/templates')

View File

@@ -1249,8 +1249,8 @@ def test_should_403_when_create_template_with_process_type_of_priority_for_non_p
@pytest.mark.parametrize('old_content, new_content, expected_paragraphs', [
(
"my favourite color is blue",
"my favourite color is ((color))",
"my favorite color is blue",
"my favorite color is ((color))",
[
'You added ((color))',
'Before you send any messages, make sure your API calls include color.',

View File

@@ -380,7 +380,7 @@ def test_a_page_should_nave_selected_navigation_item(
@pytest.mark.parametrize('endpoint, selected_nav_item', [
('main.documentation', 'Documentation'),
# ('main.documentation', 'Documentation'),
('main.support', 'Support'),
])
def test_a_page_should_nave_selected_header_navigation_item(