From 268b877d2fb05e529fcc692c68a944407fe8282f Mon Sep 17 00:00:00 2001 From: Patrick Fleming Date: Tue, 14 Jan 2025 12:01:17 +0000 Subject: [PATCH] Move Liaison and Diversion page to top of health needs task --- e2e-tests/steps/risksAndNeedsSection.ts | 2 +- .../risks-and-needs/health-needs/brainInjury.test.ts | 2 +- .../apply/risks-and-needs/health-needs/brainInjury.ts | 2 +- .../apply/risks-and-needs/health-needs/guidance.test.ts | 2 +- .../apply/risks-and-needs/health-needs/guidance.ts | 2 +- .../health-needs/liaisonAndDiversion.test.ts | 4 ++-- .../risks-and-needs/health-needs/liaisonAndDiversion.ts | 4 ++-- .../risks-and-needs/health-needs/substanceMisuse.test.ts | 2 +- .../apply/risks-and-needs/health-needs/substanceMisuse.ts | 2 +- .../pages/health-needs/_health-needs-screen.njk | 8 ++++---- server/views/applications/pages/health-needs/guidance.njk | 2 +- 11 files changed, 16 insertions(+), 16 deletions(-) diff --git a/e2e-tests/steps/risksAndNeedsSection.ts b/e2e-tests/steps/risksAndNeedsSection.ts index 5d53be2..94f348b 100644 --- a/e2e-tests/steps/risksAndNeedsSection.ts +++ b/e2e-tests/steps/risksAndNeedsSection.ts @@ -6,13 +6,13 @@ export const completeHealthNeedsTask = async (page: Page, name: string) => { await taskListPage.clickTask('Add health needs') await reviewGuidancePage(page, name) + await completeLiaisonAndDiversionPage(page, name) await completeSubstanceMisusePage(page, name) await completePhysicalHealthPage(page, name) await completeMentalHealthPage(page, name) await completeCommunicationAndLanguagePage(page, name) await completeLearningDifficultiesPage(page, name) await completeBrainInjuryPage(page, name) - await completeLiaisonAndDiversionPage(page, name) await completeOtherHealthPage(page, name) } diff --git a/server/form-pages/apply/risks-and-needs/health-needs/brainInjury.test.ts b/server/form-pages/apply/risks-and-needs/health-needs/brainInjury.test.ts index dfe8436..c7dcd47 100644 --- a/server/form-pages/apply/risks-and-needs/health-needs/brainInjury.test.ts +++ b/server/form-pages/apply/risks-and-needs/health-needs/brainInjury.test.ts @@ -53,7 +53,7 @@ describe('BrainInjury', () => { }) }) - itShouldHaveNextValue(new BrainInjury({}, application), 'liaison-and-diversion') + itShouldHaveNextValue(new BrainInjury({}, application), 'other-health') itShouldHavePreviousValue(new BrainInjury({}, application), 'learning-difficulties') describe('errors', () => { diff --git a/server/form-pages/apply/risks-and-needs/health-needs/brainInjury.ts b/server/form-pages/apply/risks-and-needs/health-needs/brainInjury.ts index 67ef0de..fded8e7 100644 --- a/server/form-pages/apply/risks-and-needs/health-needs/brainInjury.ts +++ b/server/form-pages/apply/risks-and-needs/health-needs/brainInjury.ts @@ -52,7 +52,7 @@ export default class BrainInjury implements TaskListPage { } next() { - return 'liaison-and-diversion' + return 'other-health' } errors() { diff --git a/server/form-pages/apply/risks-and-needs/health-needs/guidance.test.ts b/server/form-pages/apply/risks-and-needs/health-needs/guidance.test.ts index 897a704..9810631 100644 --- a/server/form-pages/apply/risks-and-needs/health-needs/guidance.test.ts +++ b/server/form-pages/apply/risks-and-needs/health-needs/guidance.test.ts @@ -13,7 +13,7 @@ describe('Guidance', () => { }) }) - itShouldHaveNextValue(new Guidance({}, application), 'substance-misuse') + itShouldHaveNextValue(new Guidance({}, application), 'liaison-and-diversion') itShouldHavePreviousValue(new Guidance({}, application), 'taskList') describe('errors', () => { diff --git a/server/form-pages/apply/risks-and-needs/health-needs/guidance.ts b/server/form-pages/apply/risks-and-needs/health-needs/guidance.ts index 010dad0..53c7c62 100644 --- a/server/form-pages/apply/risks-and-needs/health-needs/guidance.ts +++ b/server/form-pages/apply/risks-and-needs/health-needs/guidance.ts @@ -29,7 +29,7 @@ export default class Guidance implements TaskListPage { } next() { - return 'substance-misuse' + return 'liaison-and-diversion' } errors() { diff --git a/server/form-pages/apply/risks-and-needs/health-needs/liaisonAndDiversion.test.ts b/server/form-pages/apply/risks-and-needs/health-needs/liaisonAndDiversion.test.ts index 0b580f3..2c5dd31 100644 --- a/server/form-pages/apply/risks-and-needs/health-needs/liaisonAndDiversion.test.ts +++ b/server/form-pages/apply/risks-and-needs/health-needs/liaisonAndDiversion.test.ts @@ -23,8 +23,8 @@ describe('LiaisonAndDiversion', () => { }) }) - itShouldHaveNextValue(new LiaisonAndDiversion({}, application), 'other-health') - itShouldHavePreviousValue(new LiaisonAndDiversion({}, application), 'brain-injury') + itShouldHaveNextValue(new LiaisonAndDiversion({}, application), 'substance-misuse') + itShouldHavePreviousValue(new LiaisonAndDiversion({}, application), 'taskList') describe('errors', () => { describe('when top-level questions are unanswered', () => { diff --git a/server/form-pages/apply/risks-and-needs/health-needs/liaisonAndDiversion.ts b/server/form-pages/apply/risks-and-needs/health-needs/liaisonAndDiversion.ts index 809b36d..87c3e85 100644 --- a/server/form-pages/apply/risks-and-needs/health-needs/liaisonAndDiversion.ts +++ b/server/form-pages/apply/risks-and-needs/health-needs/liaisonAndDiversion.ts @@ -32,11 +32,11 @@ export default class LiaisonAndDiversion implements TaskListPage { } previous() { - return 'brain-injury' + return 'taskList' } next() { - return 'other-health' + return 'substance-misuse' } errors() { diff --git a/server/form-pages/apply/risks-and-needs/health-needs/substanceMisuse.test.ts b/server/form-pages/apply/risks-and-needs/health-needs/substanceMisuse.test.ts index ccb5d8f..d88f9bd 100644 --- a/server/form-pages/apply/risks-and-needs/health-needs/substanceMisuse.test.ts +++ b/server/form-pages/apply/risks-and-needs/health-needs/substanceMisuse.test.ts @@ -45,7 +45,7 @@ describe('SubstanceMisuse', () => { }) itShouldHaveNextValue(new SubstanceMisuse({}, application), 'physical-health') - itShouldHavePreviousValue(new SubstanceMisuse({}, application), 'taskList') + itShouldHavePreviousValue(new SubstanceMisuse({}, application), 'liaison-and-diversion') describe('errors', () => { describe('when top-level questions are unanswered', () => { diff --git a/server/form-pages/apply/risks-and-needs/health-needs/substanceMisuse.ts b/server/form-pages/apply/risks-and-needs/health-needs/substanceMisuse.ts index d26edf6..b842c10 100644 --- a/server/form-pages/apply/risks-and-needs/health-needs/substanceMisuse.ts +++ b/server/form-pages/apply/risks-and-needs/health-needs/substanceMisuse.ts @@ -52,7 +52,7 @@ export default class SubstanceMisuse implements TaskListPage { } previous() { - return 'taskList' + return 'liaison-and-diversion' } next() { diff --git a/server/views/applications/pages/health-needs/_health-needs-screen.njk b/server/views/applications/pages/health-needs/_health-needs-screen.njk index 162d1d5..7980d75 100644 --- a/server/views/applications/pages/health-needs/_health-needs-screen.njk +++ b/server/views/applications/pages/health-needs/_health-needs-screen.njk @@ -23,6 +23,10 @@ {{ mojSideNavigation({ label: 'Health needs navigation', items: [{ + text: 'Liaison & Diversion', + href: paths.applications.pages.show({ id: applicationId, task: 'health-needs', page: 'liaison-and-diversion' }), + active: (pageName === 'liaison-and-diversion') + }, { text: 'Substance misuse', href: paths.applications.pages.show({ id: applicationId, task: 'health-needs', page: 'substance-misuse' }), active: (pageName === 'substance-misuse') @@ -46,10 +50,6 @@ text: 'Brain injury', href: paths.applications.pages.show({ id: applicationId, task: 'health-needs', page: 'brain-injury' }), active: (pageName === 'brain-injury') - }, { - text: 'Liaison & Diversion', - href: paths.applications.pages.show({ id: applicationId, task: 'health-needs', page: 'liaison-and-diversion' }), - active: (pageName === 'liaison-and-diversion') }, { text: 'Other health', href: paths.applications.pages.show({ id: applicationId, task: 'health-needs', page: 'other-health' }), diff --git a/server/views/applications/pages/health-needs/guidance.njk b/server/views/applications/pages/health-needs/guidance.njk index 74c4e1e..897b294 100644 --- a/server/views/applications/pages/health-needs/guidance.njk +++ b/server/views/applications/pages/health-needs/guidance.njk @@ -79,7 +79,7 @@ href: paths.applications.pages.show({ id: page.application.id, task: 'health-needs', - page: 'substance-misuse' + page: 'liaison-and-diversion' }) }) }}