mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-10 10:03:21 -04:00
Convert radios on add nhs local org page (basic)
This commit is contained in:
@@ -1157,7 +1157,7 @@ class AddNHSLocalOrganisationForm(StripWhitespaceForm):
|
|||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
self.organisations.choices = organisation_choices
|
self.organisations.choices = organisation_choices
|
||||||
|
|
||||||
organisations = RadioField(
|
organisations = GovukRadiosField(
|
||||||
'Which NHS Trust or Clinical Commissioning Group do you work for?',
|
'Which NHS Trust or Clinical Commissioning Group do you work for?',
|
||||||
thing='an NHS Trust or Clinical Commissioning Group'
|
thing='an NHS Trust or Clinical Commissioning Group'
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
{% extends "withnav_template.html" %}
|
{% extends "withnav_template.html" %}
|
||||||
{% from "components/page-header.html" import page_header %}
|
{% from "components/page-header.html" import page_header %}
|
||||||
{% from "components/page-footer.html" import sticky_page_footer %}
|
{% from "components/page-footer.html" import sticky_page_footer %}
|
||||||
{% from "components/radios.html" import radios %}
|
|
||||||
{% from "components/live-search.html" import live_search %}
|
{% from "components/live-search.html" import live_search %}
|
||||||
{% from "components/form.html" import form_wrapper %}
|
{% from "components/form.html" import form_wrapper %}
|
||||||
|
|
||||||
@@ -21,13 +20,13 @@
|
|||||||
{{ form.organisations.label.text }}
|
{{ form.organisations.label.text }}
|
||||||
</p>
|
</p>
|
||||||
{{ live_search(
|
{{ live_search(
|
||||||
target_selector='.multiple-choice',
|
target_selector='.govuk-radios__item',
|
||||||
show=True,
|
show=True,
|
||||||
form=search_form,
|
form=search_form,
|
||||||
label='Search by name',
|
label='Search by name',
|
||||||
autofocus=True)
|
autofocus=True)
|
||||||
}}
|
}}
|
||||||
{{ radios(form.organisations, hide_legend=True) }}
|
{{ form.organisations }}
|
||||||
{{ sticky_page_footer('Continue') }}
|
{{ sticky_page_footer('Continue') }}
|
||||||
{% endcall %}
|
{% endcall %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -261,14 +261,14 @@ def test_nhs_local_can_create_own_organisations(
|
|||||||
'Which NHS Trust or Clinical Commissioning Group do you work for?'
|
'Which NHS Trust or Clinical Commissioning Group do you work for?'
|
||||||
)
|
)
|
||||||
assert page.select_one('[data-module=live-search]')['data-targets'] == (
|
assert page.select_one('[data-module=live-search]')['data-targets'] == (
|
||||||
'.multiple-choice'
|
'.govuk-radios__item'
|
||||||
)
|
)
|
||||||
assert [
|
assert [
|
||||||
(
|
(
|
||||||
normalize_spaces(radio.select_one('label').text),
|
normalize_spaces(radio.select_one('label').text),
|
||||||
radio.select_one('input')['value']
|
radio.select_one('input')['value']
|
||||||
)
|
)
|
||||||
for radio in page.select('.multiple-choice')
|
for radio in page.select('.govuk-radios__item')
|
||||||
] == [
|
] == [
|
||||||
('Trust 1', 't1'),
|
('Trust 1', 't1'),
|
||||||
('Trust 2', 't2'),
|
('Trust 2', 't2'),
|
||||||
|
|||||||
Reference in New Issue
Block a user