diff --git a/app/templates/components/radios.html b/app/templates/components/radios.html index d5d3682ea..b6149fa6b 100644 --- a/app/templates/components/radios.html +++ b/app/templates/components/radios.html @@ -2,12 +2,15 @@ field, hint=None, disable=[], - option_hints={} + option_hints={}, + hide_legend=False ) %}
- {{ field.label.text|safe }} + {% if hide_legend %}{% endif %} + {{ field.label.text|safe }} + {% if hide_legend %}{% endif %} {% if field.errors %} {{ field.errors[0] }} diff --git a/app/templates/views/templates/set-sender.html b/app/templates/views/templates/set-sender.html index 363499dac..5397cdf7e 100644 --- a/app/templates/views/templates/set-sender.html +++ b/app/templates/views/templates/set-sender.html @@ -13,10 +13,10 @@
{{ radios( - form.sender, - option_hints=option_hints - ) - }} + form.sender, + option_hints=option_hints, + hide_legend=True + ) }} {{ page_footer( 'Continue', back_link=url_for('.view_template', service_id=current_service.id, template_id=template_id), diff --git a/tests/app/main/views/test_send.py b/tests/app/main/views/test_send.py index 3ae9666b0..38fe48f3e 100644 --- a/tests/app/main/views/test_send.py +++ b/tests/app/main/views/test_send.py @@ -74,7 +74,9 @@ def test_show_correct_title_and_description_for_sender_type( ) assert page.select_one('h1').text == expected_title - assert normalize_spaces(page.select_one('legend').text) == expected_description + + for element in ('legend', 'legend .visually-hidden'): + assert normalize_spaces(page.select_one(element).text) == expected_description @pytest.mark.parametrize('template_mock, sender_data', [