diff --git a/cypress_shared/pages/temporary-accommodation/manage/bedspaceSearch.ts b/cypress_shared/pages/temporary-accommodation/manage/bedspaceSearch.ts index ec99bf513..46bf044de 100644 --- a/cypress_shared/pages/temporary-accommodation/manage/bedspaceSearch.ts +++ b/cypress_shared/pages/temporary-accommodation/manage/bedspaceSearch.ts @@ -64,11 +64,21 @@ export default class BedspaceSearchPage extends Page { this.checkCheckboxByNameAndValue('probationDeliveryUnits[]', pdu) }) - this.getLegend('Bedspace attributes') + this.getLegend('Property attributes') this.getLegend('Occupancy (optional)') - searchParameters.attributes.forEach(attribute => { - this.checkCheckboxByNameAndValue('attributes[]', attribute) - }) + searchParameters.attributes + .filter(attribute => attribute === 'wheelchairAccessible') + .forEach(attribute => { + this.checkCheckboxByNameAndValue('attributes[]', attribute) + }) + + this.getLegend('Bedspace attributes') + this.getLegend('Accessibility (optional)') + searchParameters.attributes + .filter(attribute => attribute !== 'wheelchairAccessible') + .forEach(attribute => { + this.checkCheckboxByNameAndValue('attributes[]', attribute) + }) } clickBedspaceLink(room: Room) { diff --git a/server/testutils/factories/bedSearchParameters.ts b/server/testutils/factories/bedSearchParameters.ts index 48b6c6698..b01478e2f 100644 --- a/server/testutils/factories/bedSearchParameters.ts +++ b/server/testutils/factories/bedSearchParameters.ts @@ -8,7 +8,7 @@ import { import { DateFormats } from '../../utils/dateUtils' import referenceData from './referenceData' -const bedSearchAttributes: Array = ['singleOccupancy', 'sharedProperty'] +const bedSearchAttributes: Array = ['singleOccupancy', 'sharedProperty', 'wheelchairAccessible'] export default Factory.define(() => ({ startDate: DateFormats.dateObjToIsoDate(faker.date.soon()), diff --git a/server/views/temporary-accommodation/bedspace-search/partials/search-fields.njk b/server/views/temporary-accommodation/bedspace-search/partials/search-fields.njk index 185941161..b684ffb32 100644 --- a/server/views/temporary-accommodation/bedspace-search/partials/search-fields.njk +++ b/server/views/temporary-accommodation/bedspace-search/partials/search-fields.njk @@ -57,27 +57,53 @@ fieldName: "probationDeliveryUnits" }, fetchContext()) }} -{% call govukFieldset({ - legend: { - text: "Bedspace attributes", - classes: "govuk-fieldset__legend--m" - } -}) %} - {{ formPageCheckboxes({ - classes: "govuk-checkboxes--small", - fieldName: "attributes", - fieldset: { - legend: { - text: "Occupancy (optional)", - classes: "govuk-fieldset__legend--s" - } - }, - hint: { - text: "Select all that apply" - }, - items: [ - { text: "Single", value: "singleOccupancy" }, - { text: "Shared", value: "sharedProperty" } - ] - }, fetchContext()) }} -{% endcall %} +
+
+ {% call govukFieldset({ + legend: { + text: "Property attributes", + classes: "govuk-fieldset__legend--m" + } + }) %} + {{ formPageCheckboxes({ + classes: "govuk-checkboxes--small", + fieldName: "attributes", + fieldset: { + legend: { + text: "Occupancy (optional)", + classes: "govuk-fieldset__legend--s" + } + }, + hint: { + text: "Select all that apply" + }, + items: [ + { text: "Single", value: "singleOccupancy" }, + { text: "Shared", value: "sharedProperty" } + ] + }, fetchContext()) }} + {% endcall %} +
+
+ {% call govukFieldset({ + legend: { + text: "Bedspace attributes", + classes: "govuk-fieldset__legend--m" + } + }) %} + {{ formPageCheckboxes({ + classes: "govuk-checkboxes--small", + fieldName: "attributes", + fieldset: { + legend: { + text: "Accessibility (optional)", + classes: "govuk-fieldset__legend--s" + } + }, + items: [ + { text: "Wheelchair accessible", value: "wheelchairAccessible" } + ] + }, fetchContext()) }} + {% endcall %} +
+