Radio buttons and list edits

This commit is contained in:
Jonathan Bobel
2023-08-25 15:31:44 -04:00
parent 8b3807da3c
commit 8ab550a22f
35 changed files with 2430 additions and 14966 deletions

View File

@@ -273,7 +273,7 @@ def test_should_show_different_change_service_name_page_for_local_services(
'Your service name should tell users what the message is about as well as who its from. For example:'
)
# when no organization on the service object, default org for the user is used for hint
assert "School admissions - Test Org" in page.find_all("ul", class_="govuk-list govuk-list--bullet")[0].text
assert "School admissions - Test Org" in page.find_all("ul", class_="usa-list usa-list--bullet")[0].text
app.service_api_client.get_service.assert_called_with(SERVICE_ONE_ID)
@@ -294,7 +294,7 @@ def test_should_show_service_org_in_hint_on_change_service_name_page_for_local_s
service_one['organization'] = '1234'
page = client_request.get('main.service_name_change', service_id=SERVICE_ONE_ID)
# when there is organization on the service object, it is used for hint text instead of user default org
assert "School admissions - Local Authority" in page.find_all("ul", class_="govuk-list govuk-list--bullet")[0].text
assert "School admissions - Local Authority" in page.find_all("ul", class_="usa-list usa-list--bullet")[0].text
def test_should_show_service_name_with_no_prefixing(
@@ -3145,7 +3145,7 @@ def test_show_international_sms_as_radio_button(
f'main.service_set_{permission}',
service_id=service_one['id'],
).select(
'.govuk-radios__item input[checked]'
'.usa-radio input[checked]'
)
assert len(checked_radios) == 1
@@ -3818,10 +3818,10 @@ def test_select_organization(
service_id=service_one['id'],
)
assert len(page.select('.govuk-radios__item')) == 3
assert len(page.select('.usa-radio')) == 3
for i in range(0, 3):
assert normalize_spaces(
page.select('.govuk-radios__item label')[i].text
page.select('.usa-radio label')[i].text
) == 'Org {}'.format(i + 1)
@@ -4114,7 +4114,7 @@ def test_view_edit_service_billing_details(
]
for label in labels:
assert label.text.strip() in labels_list
textbox_names = page.find_all('input', class_='govuk-input ')
textbox_names = page.find_all('input', class_='usa-input ')
names_list = [
'billing_contact_email_addresses',
'billing_contact_names',

View File

@@ -38,14 +38,14 @@ def test_get_should_render_add_service_template(
assert page.select_one('h1').text.strip() == 'About your service'
assert page.select_one('input[name=name]').get('value') is None
assert [
label.text.strip() for label in page.select('.govuk-radios__item label')
label.text.strip() for label in page.select('.usa-radio label')
] == [
'Federal government',
'State government',
'Other',
]
assert [
radio['value'] for radio in page.select('.govuk-radios__item input')
radio['value'] for radio in page.select('.usa-radio input')
] == [
'federal',
'state',
@@ -200,14 +200,14 @@ def test_get_should_only_show_nhs_org_types_radios_if_user_has_nhs_email(
assert page.select_one('h1').text.strip() == 'About your service'
assert page.select_one('input[name=name]').get('value') is None
assert [
label.text.strip() for label in page.select('.govuk-radios__item label')
label.text.strip() for label in page.select('.usa-radio label')
] == [
'NHS central government agency or public body',
'NHS Trust or Clinical Commissioning Group',
'GP practice',
]
assert [
radio['value'] for radio in page.select('.govuk-radios__item input')
radio['value'] for radio in page.select('.usa-radio input')
] == [
'nhs_central',
'nhs_local',

View File

@@ -166,7 +166,7 @@ def test_should_show_create_api_key_page(
page = client_request.get('main.create_api_key', service_id=SERVICE_ONE_ID)
for index, option in enumerate(expected_options):
item = page.select('.govuk-radios__item')[index]
item = page.select('.usa-radio')[index]
if type(option) is tuple:
assert normalize_spaces(item.select_one('.usa-label').text) == option[0]
assert normalize_spaces(item.select_one('.usa-hint').text) == option[1]

View File

@@ -182,7 +182,7 @@ def test_change_user_auth_preselects_current_auth_type(
'main.change_user_auth',
user_id=api_user_active['id'],
).select(
'.govuk-radios__item input[checked]'
'.usa-radio input[checked]'
)
assert len(checked_radios) == 1