From feb3bed20914f2a93016b9935cea33bda827299a Mon Sep 17 00:00:00 2001 From: Alistair Laing Date: Wed, 11 Dec 2024 08:18:11 +0000 Subject: [PATCH] Update Bedspace search param to use new values --- .../pages/temporary-accommodation/manage/bedspaceSearch.ts | 4 ++-- cypress_shared/utils/bedspaceSearch.ts | 4 ++-- server/testutils/factories/bedSearchParameters.ts | 6 +++++- .../bedspace-search/partials/search-fields.njk | 6 +++--- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/cypress_shared/pages/temporary-accommodation/manage/bedspaceSearch.ts b/cypress_shared/pages/temporary-accommodation/manage/bedspaceSearch.ts index 46bf044de..ae97aa60b 100644 --- a/cypress_shared/pages/temporary-accommodation/manage/bedspaceSearch.ts +++ b/cypress_shared/pages/temporary-accommodation/manage/bedspaceSearch.ts @@ -67,7 +67,7 @@ export default class BedspaceSearchPage extends Page { this.getLegend('Property attributes') this.getLegend('Occupancy (optional)') searchParameters.attributes - .filter(attribute => attribute === 'wheelchairAccessible') + .filter(attribute => attribute !== 'isWheelchairAccessible') .forEach(attribute => { this.checkCheckboxByNameAndValue('attributes[]', attribute) }) @@ -75,7 +75,7 @@ export default class BedspaceSearchPage extends Page { this.getLegend('Bedspace attributes') this.getLegend('Accessibility (optional)') searchParameters.attributes - .filter(attribute => attribute !== 'wheelchairAccessible') + .filter(attribute => attribute === 'isWheelchairAccessible') .forEach(attribute => { this.checkCheckboxByNameAndValue('attributes[]', attribute) }) diff --git a/cypress_shared/utils/bedspaceSearch.ts b/cypress_shared/utils/bedspaceSearch.ts index eecd994ea..4aa4cd4f6 100644 --- a/cypress_shared/utils/bedspaceSearch.ts +++ b/cypress_shared/utils/bedspaceSearch.ts @@ -4,8 +4,8 @@ export const characteristicsToSearchAttributes = ( premises: TemporaryAccommodationPremises, ): Array => { const characteristicsToSearchAttributesMap: Record = { - 'Shared property': 'sharedProperty', - 'Single occupancy': 'singleOccupancy', + 'Shared property': 'isSharedProperty', + 'Single occupancy': 'isSingleOccupancy', } return premises.characteristics diff --git a/server/testutils/factories/bedSearchParameters.ts b/server/testutils/factories/bedSearchParameters.ts index b01478e2f..a3884128e 100644 --- a/server/testutils/factories/bedSearchParameters.ts +++ b/server/testutils/factories/bedSearchParameters.ts @@ -8,7 +8,11 @@ import { import { DateFormats } from '../../utils/dateUtils' import referenceData from './referenceData' -const bedSearchAttributes: Array = ['singleOccupancy', 'sharedProperty', 'wheelchairAccessible'] +const bedSearchAttributes: Array = [ + 'isSingleOccupancy', + 'isSharedProperty', + 'isWheelchairAccessible', +] 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 b684ffb32..6d082ecff 100644 --- a/server/views/temporary-accommodation/bedspace-search/partials/search-fields.njk +++ b/server/views/temporary-accommodation/bedspace-search/partials/search-fields.njk @@ -78,8 +78,8 @@ text: "Select all that apply" }, items: [ - { text: "Single", value: "singleOccupancy" }, - { text: "Shared", value: "sharedProperty" } + { text: "Single", value: "isSingleOccupancy" }, + { text: "Shared", value: "isSharedProperty" } ] }, fetchContext()) }} {% endcall %} @@ -101,7 +101,7 @@ } }, items: [ - { text: "Wheelchair accessible", value: "wheelchairAccessible" } + { text: "Wheelchair accessible", value: "isWheelchairAccessible" } ] }, fetchContext()) }} {% endcall %}