Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAP-575 rename flexion techniques #667

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ parameters:

node-version:
type: string
default: 18.17.1-browsers
default: 21.5.0-browsers

executors:
integration-tests:
docker:
- image: cimg/node:<< pipeline.parameters.node-version >>
- image: circleci/postgres:10.13-ram
- image: cimg/postgres:14.7
environment:
POSTGRES_PASSWORD: use-of-force
POSTGRES_USER: use-of-force
Expand All @@ -39,7 +39,7 @@ jobs:
- checkout
- run:
name: Update npm
command: 'sudo npm install -g npm@9'
command: 'sudo npm install -g npm@10'
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
- run:
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18.17.1 as builder
FROM node:21.5.0 as builder

ARG BUILD_NUMBER
ARG GIT_REF
Expand All @@ -24,7 +24,7 @@ RUN CYPRESS_INSTALL_BINARY=0 npm ci --no-audit && \

RUN npm prune --production

FROM node:18.17.1-slim
FROM node:21.5.0-slim
LABEL maintainer="HMPPS Digital Studio <[email protected]>"

# Cache breaking
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/pages/sections/reportDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ module.exports = {
cy.get('[data-qa="restraintUsed"]').contains('Yes - standing, on back (supine), on front (prone), kneeling')
handcuffsApplied().contains('Yes')
painInducingTechniques().contains('Yes')
cy.get('[data-qa="painInducingTechniques"]').contains('Yes - final lock flexion, thumb lock')
cy.get('[data-qa="painInducingTechniques"]').contains('Yes - wrist flexion, thumb lock')

cy.get('[data-qa="prisonerRelocation"]').contains('Segregation unit')
prisonerCompliant().contains('Yes')
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
"security_audit": "npx audit-ci --config audit-ci.json"
},
"engines": {
"node": "^18",
"npm": "<10"
"node": "^21",
"npm": "^10"
},
"jest": {
"transform": {
Expand Down
7 changes: 5 additions & 2 deletions server/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export const ControlAndRestraintPosition = toEnum({
})

export const PainInducingTechniquesUsed = toEnum({
FINAL_LOCK_FLEXION: { value: 'FINAL_LOCK_FLEXION', label: 'Final lock flexion' },
FINAL_LOCK_ROTATION: { value: 'FINAL_LOCK_ROTATION', label: 'Final lock rotation' },
FINAL_LOCK_FLEXION: { value: 'FINAL_LOCK_FLEXION', label: 'Wrist flexion' },
FINAL_LOCK_ROTATION: { value: 'FINAL_LOCK_ROTATION', label: 'Wrist rotation' },
MANDIBULAR_ANGLE_TECHNIQUE: { value: 'MANDIBULAR_ANGLE_TECHNIQUE', label: 'Mandibular angle technique' },
SHOULDER_CONTROL: { value: 'SHOULDER_CONTROL', label: 'Shoulder control' },
THROUGH_RIGID_BAR_CUFFS: { value: 'THROUGH_RIGID_BAR_CUFFS', label: 'Through rigid bar cuffs' },
Expand All @@ -43,6 +43,9 @@ export const RelocationLocation = toEnum({
SEGREGATION_UNIT: { value: 'SEGREGATION_UNIT', label: 'Segregation unit' },
SPECIAL_ACCOMMODATION: { value: 'SPECIAL_ACCOMMODATION', label: 'Special accommodation' },
CELLULAR_VEHICLE: { value: 'CELLULAR_VEHICLE', label: 'Cellular vehicle' },
RECEPTION: { value: 'RECEPTION', label: 'Reception' },
OTHER_WING: { value: 'OTHER_WING', label: 'Other wing' },
FACILITATE_RELEASE: { value: 'FACILITATE_RELEASE', label: 'To facilitate release' },
})

export const ReportStatus = toEnum({
Expand Down
2 changes: 1 addition & 1 deletion server/routes/maintainingReports/admin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ describe('/:reportId/edit-report', () => {
expect(reportService.update).not.toHaveBeenCalled()
expect(flash).toHaveBeenCalledWith('errors', {
href: '#form',
text: 'Unexpected token h in JSON at position 1',
text: "Unexpected token 'h', \"this isn't json!\" is not valid JSON",
})
})
})
Expand Down
4 changes: 2 additions & 2 deletions server/services/reportSummary.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ describe('reportSummary', () => {
form.useOfForceDetails.painInducingTechniques = true
form.useOfForceDetails.painInducingTechniquesUsed = ['FINAL_LOCK_FLEXION']
const result = reportSummary(form, offenderDetail, prison, locationDescription, involvedStaff, incidentDate)
expect(result.useOfForceDetails.painInducingTechniques).toEqual('Yes - Final lock flexion')
expect(result.useOfForceDetails.painInducingTechniques).toEqual('Yes - Wrist flexion')
})

it('should return 2 techniques used', () => {
form.useOfForceDetails.painInducingTechniques = true
form.useOfForceDetails.painInducingTechniquesUsed = ['FINAL_LOCK_FLEXION', 'THUMB_LOCK']
const result = reportSummary(form, offenderDetail, prison, locationDescription, involvedStaff, incidentDate)
expect(result.useOfForceDetails.painInducingTechniques).toEqual('Yes - Final lock flexion, Thumb lock')
expect(result.useOfForceDetails.painInducingTechniques).toEqual('Yes - Wrist flexion, Thumb lock')
})

it('should return "No"', () => {
Expand Down
Loading