Skip to content

Commit

Permalink
MAP-1568: content update amending questions to be prisoner specific
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleygyngell committed Aug 22, 2024
1 parent 26410a1 commit b6f3f8b
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ context('A reporter views their own report', () => {

const yourReportPage = YourReportPage.verifyOnPage()
yourReportPage.location().contains('–')
yourReportPage.batonDrawnAgainstPrisonerLabel().contains('Was a baton drawn against the prisoner?')
yourReportPage.pavaDrawnAgainstPrisonerLabel().contains('Was PAVA drawn against the prisoner?')
yourReportPage.batonDrawnAgainstPrisonerLabel().contains('Was a baton drawn by anyone against this prisoner?')
yourReportPage.pavaDrawnAgainstPrisonerLabel().contains('Was PAVA drawn by anyone against this prisoner?')
})

it('A user can view reports and it will show the old version of the Baton and PAVA questions', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ const selectPrimaryUofReasonPage = () =>
},
() => {
cy.get('h1').contains('Use of force details')
cy.get('legend.govuk-fieldset__legend--l').contains('What was the primary reason use of force was applied?')
cy.get('legend.govuk-fieldset__legend--l').contains(
'What was the primary reason use of force was applied against this prisoner?'
)
}
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const selectUofReasonsPage = () =>
},
() => {
cy.get('h1').contains('Use of force details')
cy.get('legend.govuk-fieldset__legend--l').contains('Why was use of force applied?')
cy.get('legend.govuk-fieldset__legend--l').contains('Why was use of force applied against this prisoner?')
}
)

Expand Down
8 changes: 4 additions & 4 deletions server/routes/creatingReports/checkYourAnswers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ describe('GET /check-your-answers', () => {
.expect(200)
.expect('Content-Type', /html/)
.expect(res => {
expect(res.text).not.toContain('Which pain inducing techniques were used?')
expect(res.text).not.toContain('Which pain inducing techniques were used against this prisoner?')
})
})

Expand All @@ -98,7 +98,7 @@ describe('GET /check-your-answers', () => {
.expect(200)
.expect('Content-Type', /html/)
.expect(res => {
expect(res.text).toContain('Which pain inducing techniques were used?')
expect(res.text).toContain('Which pain inducing techniques were used against this prisoner?')
})
})

Expand All @@ -125,7 +125,7 @@ describe('GET /check-your-answers', () => {
.expect(200)
.expect('Content-Type', /html/)
.expect(res => {
expect(res.text).toContain('Which pain inducing techniques were used?')
expect(res.text).toContain('Which pain inducing techniques were used against this prisoner?')
})
})

Expand All @@ -151,7 +151,7 @@ describe('GET /check-your-answers', () => {
.expect(200)
.expect('Content-Type', /html/)
.expect(res => {
expect(res.text).toContain('Which pain inducing techniques were used?')
expect(res.text).toContain('Which pain inducing techniques were used against this prisoner?')
})
})
it('Should contain prisoner compliant', () => {
Expand Down
6 changes: 3 additions & 3 deletions server/routes/creatingReports/whyWasUoFApplied.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('/why-was-uof-applied', () => {
.get(paths.whyWasUofApplied(-19))
.expect('Content-Type', /html/)
.expect(res => {
expect(res.text).toContain('Why was use of force applied?')
expect(res.text).toContain('Why was use of force applied against this prisoner?')
expect(res.text).toContain(UofReasons.ASSAULT_BY_A_MEMBER_OF_PUBLIC.label)
})
})
Expand Down Expand Up @@ -131,7 +131,7 @@ describe('/what-was-the-primary-reason-of-uof', () => {
.get(paths.whatWasPrimaryReasonForUoF(-19))
.expect('Content-Type', /html/)
.expect(res => {
expect(res.text).toContain('What was the primary reason use of force was applied?')
expect(res.text).toContain('What was the primary reason use of force was applied against this prisoner?')
expect(res.text).toContain(UofReasons.ASSAULT_ON_ANOTHER_PRISONER.label)
expect(res.text).toContain(UofReasons.HOSTAGE_NTRG.label)
// Not present as reasons from flash used rather than DB
Expand All @@ -150,7 +150,7 @@ describe('/what-was-the-primary-reason-of-uof', () => {
.get(paths.whatWasPrimaryReasonForUoF(-19))
.expect('Content-Type', /html/)
.expect(res => {
expect(res.text).toContain('What was the primary reason use of force was applied?')
expect(res.text).toContain('What was the primary reason use of force was applied against this prisoner?')
expect(res.text).toContain(UofReasons.ASSAULT_ON_ANOTHER_PRISONER.label)
expect(res.text).toContain(UofReasons.ASSAULT_BY_A_MEMBER_OF_PUBLIC.label)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ <h1 class="govuk-heading-xl mainHeading">{{ pageTitle }}</h1>
name: "primaryReason",
fieldset: {
legend: {
text: "What was the primary reason use of force was applied?",
text: "What was the primary reason use of force was applied against this prisoner?",
isPageHeading: false,
classes: "govuk-fieldset__legend--l govuk-!-margin-bottom-8"
}
Expand Down
4 changes: 2 additions & 2 deletions server/views/formPages/incident/select-uof-reasons.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% from "govuk/components/checkboxes/macro.njk" import govukCheckboxes %}
{% from "govuk/components/button/macro.njk" import govukButton %}

{% set pageTitle = 'Use of force details - why was use of force applied?' %}
{% set pageTitle = 'Use of force details - why was use of force applied against this prisoner?' %}
{% set saveButtonInEditModeText = 'Save and continue' %}

{% block formItems %}
Expand All @@ -15,7 +15,7 @@ <h1 class="govuk-heading-xl mainHeading">Use of force details</h1>
name: "reasons[]",
fieldset: {
legend: {
text: "Why was use of force applied?",
text: "Why was use of force applied against this prisoner?",
isPageHeading: false,
classes: "govuk-fieldset__legend--l govuk-!-margin-bottom-8"
}
Expand Down
22 changes: 11 additions & 11 deletions server/views/formPages/incident/useOfForceDetails.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ <h1 class="govuk-heading-xl mainHeading">{{ pageTitle }}</h1>

<!-- Q1 -->
{{ incidentMacro.radio( {
text: "Was positive communication used to de-escalate the situation?",
text: "Was positive communication used to de-escalate the situation with this prisoner?",
name: "positiveCommunication",
value: data.positiveCommunication,
options: yesNoOptions,
Expand All @@ -50,7 +50,7 @@ <h1 class="govuk-heading-xl mainHeading">{{ pageTitle }}</h1>

<!-- Q3 -->
{{ incidentMacro.radio( {
text: "Were any personal protection techniques used?",
text: "Were any personal protection techniques used against this prisoner?",
name: "personalProtectionTechniques",
value: data.personalProtectionTechniques,
options: yesNoOptions,
Expand All @@ -60,14 +60,14 @@ <h1 class="govuk-heading-xl mainHeading">{{ pageTitle }}</h1>
<!-- Q4 -->
{{ incidentMacro.radiosWithNestedRadios({
primaryQuestion: {
text: "Was a baton drawn against the prisoner?",
text: "Was a baton drawn by anyone against this prisoner?",
name: "batonDrawnAgainstPrisoner",
value: data.batonDrawnAgainstPrisoner,
options: yesNoOptions,
errorMessage: errors | findError('batonDrawnAgainstPrisoner')
},
followUpQuestion: {
text: "Was it used?",
text: "Was it used against this prisoner?",
value: data.batonUsed,
name: "batonUsed",
options: yesNoOptions,
Expand All @@ -81,15 +81,15 @@ <h1 class="govuk-heading-xl mainHeading">{{ pageTitle }}</h1>
<!-- Q5 -->
{{ incidentMacro.radiosWithNestedRadios({
primaryQuestion: {
text: "Was PAVA drawn against the prisoner?",
text: "Was PAVA drawn by anyone against this prisoner?",
name: "pavaDrawnAgainstPrisoner",
value: data.pavaDrawnAgainstPrisoner,
options: yesNoOptions,
errorMessage: errors | findError('pavaDrawnAgainstPrisoner')

},
followUpQuestion: {
text: "Was it used?",
text: "Was it used against this prisoner?",
name: "pavaUsed",
value: data.pavaUsed,
options: yesNoOptions,
Expand Down Expand Up @@ -120,7 +120,7 @@ <h1 class="govuk-heading-xl mainHeading">{{ pageTitle }}</h1>
<!-- Q7 -->
{{ incidentMacro.radiosWithNestedRadios({
primaryQuestion: {
text: "Was a guiding hold used?",
text: "Was a guiding hold used against this prisoner?",
name: "guidingHold",
value: data.guidingHold,
options: yesNoOptions,
Expand Down Expand Up @@ -148,7 +148,7 @@ <h1 class="govuk-heading-xl mainHeading">{{ pageTitle }}</h1>

<!-- Q8 -->
{{ incidentMacro.radio( {
text: "Was an escorting hold used?",
text: "Was an escorting hold used against this prisoner?",
name: "escortingHold",
value: data.escortingHold,
options: yesNoOptions,
Expand All @@ -159,7 +159,7 @@ <h1 class="govuk-heading-xl mainHeading">{{ pageTitle }}</h1>
<div id="control-and-restraint">
{{ incidentMacro.checkboxesWithNestedCheckboxes({
primaryQuestion: {
text: "Which control and restraint positions were used?",
text: "Which control and restraint positions were used against this prisoner?",
hint: "Select all that apply.",
name: "restraintPositions",
value: data.restraintPositions | toArray,
Expand All @@ -174,7 +174,7 @@ <h1 class="govuk-heading-xl mainHeading">{{ pageTitle }}</h1>
<div id="pain-inducing-techniques">
{{ incidentMacro.checkboxesWithNestedCheckboxes({
primaryQuestion: {
text: "Which pain inducing techniques were used?",
text: "Which pain inducing techniques were used against this prisoner?",
hint: "Select all that apply.",
name: "painInducingTechniquesUsed",
value: data.painInducingTechniquesUsed or [],
Expand All @@ -187,7 +187,7 @@ <h1 class="govuk-heading-xl mainHeading">{{ pageTitle }}</h1>

<!-- 11 -->
{{ incidentMacro.radio( {
text: "Were handcuffs applied?",
text: "Were handcuffs applied against this prisoner?",
name: "handcuffsApplied",
value: data.handcuffsApplied,
options: yesNoOptions,
Expand Down
22 changes: 11 additions & 11 deletions server/views/pages/reportDetailMacro.njk
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
{% if data.useOfForceDetails.reasonsForUseOfForce %}
{{
reportDetailsMacros.tableRow({
label: 'Why was use of force applied?',
label: 'Why was use of force applied against this prisoner?',
'data-qa': 'reasonsForUseOfForce',
dataValue: data.useOfForceDetails.reasonsForUseOfForce,
print: print
Expand All @@ -165,7 +165,7 @@
{% if data.useOfForceDetails.primaryReason %}
{{
reportDetailsMacros.tableRow({
label: 'What was the primary reason use of force was applied?',
label: 'What was the primary reason use of force was applied against this prisoner?',
'data-qa': 'primaryReason',
dataValue: data.useOfForceDetails.primaryReason,
print: print
Expand All @@ -174,7 +174,7 @@
{% endif %}
{{
reportDetailsMacros.tableRow({
label: 'Was positive communication used to de-escalate the situation?',
label: 'Was positive communication used to de-escalate the situation with this prisoner?',
'data-qa': 'positiveCommunication',
dataValue: data.useOfForceDetails.positiveCommunicationUsed | toYesNo,
print: print
Expand All @@ -192,7 +192,7 @@

{{
reportDetailsMacros.tableRow({
label: 'Were any personal protection techniques used?',
label: 'Were any personal protection techniques used against this prisoner?',
'data-qa': 'personalProtection',
dataValue: data.useOfForceDetails.personalProtectionTechniques | toYesNo,
print: print
Expand All @@ -211,7 +211,7 @@
{% else %}
{{
reportDetailsMacros.tableRow({
label: 'Was a baton drawn against the prisoner?',
label: 'Was a baton drawn by anyone against this prisoner?',
'data-qa': 'batonDrawnAgainstPrisoner',
dataValue: data.useOfForceDetails.batonDrawnAgainstPrisoner,
print: print
Expand All @@ -231,7 +231,7 @@
{% else %}
{{
reportDetailsMacros.tableRow({
label: 'Was PAVA drawn against the prisoner?',
label: 'Was PAVA drawn by anyone against this prisoner?',
'data-qa': 'pavaDrawnAgainstPrisoner',
dataValue: data.useOfForceDetails.pavaDrawnAgainstPrisoner,
print: print
Expand All @@ -252,7 +252,7 @@

{{
reportDetailsMacros.tableRow({
label: 'Was a guiding hold used?',
label: 'Was a guiding hold used against this prisoner?',
'data-qa': 'guidingHold',
dataValue: data.useOfForceDetails.guidingHoldUsed | capitalize,
print: print
Expand All @@ -261,7 +261,7 @@
{% if data.useOfForceDetails.escortingHoldUsed != undefined %}
{{
reportDetailsMacros.tableRow({
label: 'Was an escorting hold used?',
label: 'Was an escorting hold used against this prisoner?',
'data-qa': 'escortingHold',
dataValue: data.useOfForceDetails.escortingHoldUsed | toYesNo,
print: print
Expand All @@ -270,7 +270,7 @@
{% endif %}
{{
reportDetailsMacros.tableRow({
label: 'Which control and restraint techniques were used?',
label: 'Which control and restraint positions were used against this prisoner?',
'data-qa': 'restraintUsed',
dataValue: data.useOfForceDetails.controlAndRestraintUsed | toArray,
print: print,
Expand All @@ -282,7 +282,7 @@
{% if data.useOfForceDetails.painInducingTechniques != undefined and not details.painInducingTechniquesUsed %}
{{
reportDetailsMacros.tableRow({
label: 'Which pain inducing techniques were used?',
label: 'Which pain inducing techniques were used against this prisoner?',
'data-qa': 'painInducingTechniques',
dataValue: data.useOfForceDetails.painInducingTechniques | capitalize,
print: print
Expand All @@ -291,7 +291,7 @@
{% endif %}
{{
reportDetailsMacros.tableRow({
label: 'Were handcuffs applied?',
label: 'Were handcuffs applied against this prisoner?',
'data-qa': 'handcuffsApplied',
dataValue: data.useOfForceDetails.handcuffsApplied | toYesNo,
print: print
Expand Down

0 comments on commit b6f3f8b

Please sign in to comment.