+ {% if hint %}
+ {% set attributes = {"aria-describedby": field.name + '-hint'} %}
+ {% else %}
+ {% set attributes = {} %}
+ {% endif %}
+ {% call govukFieldset({
+ "legend": {
+ "text": field.label.text,
+ "isPageHeading": False
+ },
+ "attributes": attributes
+ })
+ %}
+ {% if hint %}
+
+ {{ hint }}
-
- {% if error %}
+ {% endif %}
+
+ {% for entry in field.entries %}
+
+ {% if not autocomplete %}
+ {% set autocomplete = "off" %}
+ {% else %}
+ {% set autocomplete = "" %}
+ {% endif %}
+ {% if entry.errors %}
+ {% set label_classes = "govuk-input--numbered__label govuk-input--numbered__label--error" %}
+ {% else %}
+ {% set label_classes = "govuk-input--numbered__label" %}
+ {% endif %}
+ {% set field_name = field.name + "-" + loop.index|string %}
+ {{ entry(param_extensions={
+ "id": "input-" + field_name,
+ "name": field_name,
+ "label": {
+ "html": '' + item_name + ' number ' + loop.index|string + '.',
+ "classes": label_classes
+ },
+ "classes": "govuk-input--numbered govuk-!-width-full",
+ "value": field.data[loop.index0],
+ "autocomplete": autocomplete
+ }) }}
+
+ {% endfor %}
- {% endif %}
+ {% endcall %}
{% endmacro %}
diff --git a/tests/app/main/views/organisations/test_organisation.py b/tests/app/main/views/organisations/test_organisation.py
index 9457c2f61..4aff7ba3a 100644
--- a/tests/app/main/views/organisations/test_organisation.py
+++ b/tests/app/main/views/organisations/test_organisation.py
@@ -902,27 +902,27 @@ def test_view_organisation_domains(
org_id=ORGANISATION_ID,
)
- assert [textbox['value'] for textbox in page.select('input[type=text]')] == [
+ assert [textbox.get('value') for textbox in page.select('input[type=text]')] == [
'example.gov.uk',
'test.example.gov.uk',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
+ None,
+ None,
+ None,
+ None,
+ None,
+ None,
+ None,
+ None,
+ None,
+ None,
+ None,
+ None,
+ None,
+ None,
+ None,
+ None,
+ None,
+ None,
]
diff --git a/tests/app/main/views/test_api_integration.py b/tests/app/main/views/test_api_integration.py
index c3ecce6c4..17a9a361d 100644
--- a/tests/app/main/views/test_api_integration.py
+++ b/tests/app/main/views/test_api_integration.py
@@ -412,7 +412,7 @@ def test_route_invalid_permissions(
service_one)
-def test_should_show_whitelist_page(
+def test_should_show_guestlist_page(
client_request,
mock_login,
api_user_active,
@@ -424,14 +424,14 @@ def test_should_show_whitelist_page(
'main.guest_list',
service_id=SERVICE_ONE_ID,
)
- textboxes = page.find_all('input', {'type': 'text'})
+ textboxes = page.find_all('input', {'class': 'govuk-input'})
for index, value in enumerate(
- ['test@example.com'] + [''] * 4 + ['07900900000'] + [''] * 4
+ ['test@example.com'] + [None] * 4 + ['07900900000'] + [None] * 4
):
- assert textboxes[index]['value'] == value
+ assert textboxes[index].get('value') == value
-def test_should_update_whitelist(
+def test_should_update_guestlist(
client_request,
mock_update_guest_list,
):
@@ -453,7 +453,7 @@ def test_should_update_whitelist(
'phone_numbers': ['07900900000', '+1800-555-555']})
-def test_should_validate_whitelist_items(
+def test_should_validate_guestlist_items(
client_request,
mock_update_guest_list,
):
diff --git a/tests/javascripts/listEntry.test.js b/tests/javascripts/listEntry.test.js
index 03f18e737..3ebfbb5a0 100644
--- a/tests/javascripts/listEntry.test.js
+++ b/tests/javascripts/listEntry.test.js
@@ -49,10 +49,12 @@ describe("List entry", () => {
for (let idx = 0; idx < 10; idx++) {
result += `
`;
}
@@ -60,15 +62,14 @@ describe("List entry", () => {
};
document.body.innerHTML =
- `