From edfc06185891500384bbd6de665cc7a586a858c6 Mon Sep 17 00:00:00 2001 From: GCheema <50441412+GurnankCheema@users.noreply.github.com> Date: Wed, 17 Jan 2024 08:51:07 +0000 Subject: [PATCH] MAP-578 added restraing and kneeling options to prisonr compliance question (#669) --- .../reportPages/relocation-and-injuries.cy.js | 34 +++++++++++++++++++ server/config/types.ts | 2 ++ 2 files changed, 36 insertions(+) diff --git a/integration-tests/integration/reportPages/relocation-and-injuries.cy.js b/integration-tests/integration/reportPages/relocation-and-injuries.cy.js index 8cccd347..b93bbbf5 100644 --- a/integration-tests/integration/reportPages/relocation-and-injuries.cy.js +++ b/integration-tests/integration/reportPages/relocation-and-injuries.cy.js @@ -134,6 +134,40 @@ context('Submitting use of force details page', () => { ) }) + it('Compliancy of "No" and "KNEELING" is stored correctly', () => { + fillFormAndSave() + relocationAndInjuries.prisonerCompliant().check('false') + relocationAndInjuries.relocationType().check('KNEELING') + relocationAndInjuries.userSpecifiedRelocationType().should('not.be.visible') + relocationAndInjuries.clickSaveAndContinue() + + cy.task('getFormSection', { bookingId: offender.bookingId, formName: 'relocationAndInjuries' }).then( + ({ section }) => { + expect(section).to.deep.equal({ + prisonerRelocation: 'SEGREGATION_UNIT', + relocationCompliancy: false, + relocationType: 'KNEELING', + healthcareInvolved: true, + f213CompletedBy: 'Dr Taylor', + prisonerInjuries: true, + healthcarePractionerName: 'Dr Smith', + prisonerHospitalisation: true, + staffMedicalAttention: true, + staffNeedingMedicalAttention: [ + { + name: 'Eddie Thomas', + hospitalisation: true, + }, + { + name: 'Jayne Eyre', + hospitalisation: true, + }, + ], + }) + } + ) + }) + it('Displays validation messages', () => { fillFormAndSave() relocationAndInjuries.prisonerCompliant().check('false') diff --git a/server/config/types.ts b/server/config/types.ts index 6cf67130..4e12c941 100644 --- a/server/config/types.ts +++ b/server/config/types.ts @@ -65,6 +65,8 @@ export const RelocationType = toEnum({ FULL: { value: 'FULL', label: 'Full relocation' }, VEHICLE: { value: 'VEHICLE', label: 'Relocated to vehicle' }, NTRG: { value: 'NTRG', label: 'Handed to local staff (NTRG)' }, + SEARCH_UNDER_RESTRAINT: { value: 'SEARCH_UNDER_RESTRAINT', label: 'Full search under restraint' }, + KNEELING: { value: 'KNEELING', label: 'Kneeling' }, OTHER: { value: 'OTHER', label: 'Other' }, })