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

C8 refuge epic #1668

Open
wants to merge 76 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
4e03cd5
Update values.preview.template.yaml
AlokDatta Sep 18, 2024
c64f227
Audit issues suppressed
AlokDatta Sep 18, 2024
8d813d5
Merge branch 'master' into feature/c8-refuge-policy-changes-epic
AlokDatta Sep 23, 2024
bc1065d
Merge branch 'master' into feature/c8-refuge-policy-changes-epic
AlokDatta Sep 27, 2024
4995fde
Added url for refuge page
Oct 2, 2024
f1b4e4d
added refuge to c100 sequence
Oct 2, 2024
cbc6c31
changes to frontend for prototype
JamesCuttsHmcts Oct 4, 2024
7bea719
Updated upload a document screen to match solicitor journey
JamesCuttsHmcts Oct 7, 2024
f47038c
fixed bug where journey wouldn't continue to check your answers
JamesCuttsHmcts Oct 8, 2024
58f64f3
Added field to cya
JamesCuttsHmcts Oct 8, 2024
b8913d7
Changed variables so they would map better
JamesCuttsHmcts Oct 9, 2024
2b5c074
updated form upload page
JamesCuttsHmcts Oct 10, 2024
a8f28df
Changes to do you live in refuge page based off discussions with Alok
JamesCuttsHmcts Oct 10, 2024
22d3394
Changed flow
JamesCuttsHmcts Oct 10, 2024
ce29481
changes based off jason's feedback
JamesCuttsHmcts Oct 10, 2024
c77a8fe
Merge branch 'master' into feature/c8-refuge-policy-changes-epic
AlokDatta Oct 13, 2024
3418335
Merge branch 'feature/c8-refuge-policy-changes-epic' into feature/c8-…
hcarslaw Oct 16, 2024
a79e1e6
PRL-6433: Add refuge prototype for applicant and respondent
hcarslaw Oct 17, 2024
edd5e8d
Merge branch 'master' into feature/c8-refuge-policy-changes-epic
AlokDatta Oct 18, 2024
af4e464
PRL-6433: Update applicant/respondent refuge journeys
hcarslaw Oct 18, 2024
2457b7e
PRL-6433: Initial changes for C100 refuge journey
hcarslaw Oct 18, 2024
93362e9
Merge branch 'feature/c8-refuge-policy-changes-epic' into feature/c8-…
JamesCuttsHmcts Oct 21, 2024
fcb17eb
PRL-6433: Add changes for C100 applicant refuge screens
hcarslaw Oct 21, 2024
f336a85
Merge branch 'master' into feature/c8-refuge-policy-changes-epic
AlokDatta Oct 22, 2024
4f1df48
Merge branch 'feature/c8-refuge-policy-changes-epic' into feature/c8-…
hcarslaw Oct 22, 2024
10750f2
PRL-6433: Changes for C100 other person refuge screens
hcarslaw Oct 22, 2024
01d3175
PRL-6433: Delete uploadC8Again value on loading c8 already uploaded s…
hcarslaw Oct 22, 2024
b920ef9
PRL-6433: Make refuge question mandatory and add it to response taskl…
hcarslaw Oct 23, 2024
07b7614
Fix build issues
hcarslaw Oct 23, 2024
202502d
PRL-6433: Fix error messages for staying in refuge screen
hcarslaw Oct 23, 2024
7be8f9f
Add test cases and improvements for C8 refuge journeys
hcarslaw Oct 24, 2024
971fe1f
Remove unused code
hcarslaw Oct 24, 2024
788f4b4
Fix sonar issues
hcarslaw Oct 24, 2024
24c0201
Fix sonar issues
hcarslaw Oct 24, 2024
13824c3
Fix sonar issues
hcarslaw Oct 24, 2024
995c32f
Merge pull request #1695 from hmcts/c8-refuge-sonar-fixes
hcarslaw Oct 24, 2024
fd1a1ba
Add unit tests for refuge sequence and navigation controller
hcarslaw Oct 24, 2024
e4ff036
Add welsh translations for C8 refuge screens
hcarslaw Oct 25, 2024
e01a640
Fixes for review comments and other improvements
hcarslaw Oct 25, 2024
b9dbcc8
Fix refuge upload document edit link
hcarslaw Oct 25, 2024
ac9f8b5
Merge pull request #1684 from hmcts/feature/c8-policy-changes-prototype
AlokDatta Oct 28, 2024
06a98fa
Fix delete document when live in refuge changed to no for CA/DA journey
hcarslaw Oct 28, 2024
0016a04
Improve test coverage
hcarslaw Oct 29, 2024
63e441b
Merge branch 'master' into feature/c8-refuge-policy-changes-epic
AlokDatta Oct 30, 2024
9751977
Fix delete document when live in refuge changed to no for CA/DA journey
hcarslaw Oct 30, 2024
c9d2786
Fix sonar issues
hcarslaw Oct 30, 2024
cd17a67
Update link to c8 refuge form
hcarslaw Oct 31, 2024
cb46f09
Merge branch 'master' into feature/c8-refuge-policy-changes-epic
AlokDatta Nov 1, 2024
a896690
PRL-6571: Fix applicant save and come back later
hcarslaw Nov 1, 2024
1c0ea22
Change refuge upload multiple files error text from delete to remove
hcarslaw Nov 5, 2024
8ddda50
Merge branch 'master' into feature/c8-refuge-policy-changes-epic
hcarslaw Nov 5, 2024
8dbf646
Update refuge document already uploaded title
hcarslaw Nov 6, 2024
b0960a6
Merge branch 'master' into feature/c8-refuge-policy-changes-epic
hcarslaw Nov 6, 2024
61d4021
Update staying in refuge error message for C100 other person
hcarslaw Nov 6, 2024
126ada8
PRL-6618: Stop deleting historical refuge documents
hcarslaw Nov 8, 2024
e01503f
PRL-6620: Fix submitting refuge without refuge document
hcarslaw Nov 12, 2024
24fa71e
PRL-6620: Improve test coverage
hcarslaw Nov 12, 2024
c63f1fa
PRL-6620: Add refuge cya errors to error summary
hcarslaw Nov 13, 2024
2a9f566
PRL-6620: Fix review comments
hcarslaw Nov 14, 2024
5a176fb
Merge pull request #1705 from hmcts/PRL-6620
hcarslaw Nov 14, 2024
538bfed
Merge branch 'master' into feature/c8-refuge-policy-changes-epic
sairamkantheti1 Nov 18, 2024
d16e0ac
supressed vulnarabilities
sairamkantheti1 Nov 18, 2024
53eb4bb
update yml files
Nov 22, 2024
18a2a9b
yarn audit known issues
Nov 22, 2024
01ef57f
update end to end tests for c8 refuge changes
Nov 22, 2024
0c631f5
remove unnecessary spacing
Nov 29, 2024
270bec9
Enable webpack error details in pipeline progress
vivek-sekhar Nov 29, 2024
2435eaa
yarn audit known issues
Dec 4, 2024
9792adc
Merge branch 'master' into feature/c8-refuge-policy-changes-epic
hcarslaw Dec 4, 2024
6f8d342
remove comments
Dec 19, 2024
81d65ce
Update the tag
Dec 19, 2024
50ade34
yarn known audit issues
Dec 19, 2024
c20d11d
Merge branch 'master' into feature/c8-refuge-policy-changes-epic
hcarslaw Dec 19, 2024
23ce29c
Merge branch 'feature/c8-refuge-policy-changes-epic' into c8-refuge-f…
hcarslaw Dec 19, 2024
66363ae
Merge pull request #1709 from hmcts/c8-refuge-fix-functional-tests
sairamkantheti1 Dec 19, 2024
b706d80
Fix merge conflicts
hcarslaw Dec 20, 2024
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 charts/prl-citizen-frontend/values.preview.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ nodejs:
SERVICE_AUTH_PROVIDER_URL: 'http://rpe-service-auth-provider-{{ .Values.global.environment }}.service.core-compute-{{ .Values.global.environment }}.internal'
IDAM_WEB_URL: 'https://idam-web-public.{{ .Values.global.environment }}.platform.hmcts.net/login'
IDAM_API_URL: 'https://idam-api.{{ .Values.global.environment }}.platform.hmcts.net/o/token'
CCD_URL: 'https://ccd-data-store-api-prl-ccd-definitions-pr-2429.preview.platform.hmcts.net'
EQUALITY_URL: 'https://pcq.aat.platform.hmcts.net'
CCD_URL: 'http://ccd-data-store-api-aat.service.core-compute-aat.internal'
DOCUMENT_MANAGEMENT_URL: 'http://ccd-case-document-am-api-aat.service.core-compute-aat.internal'
COS_URL: 'http://prl-cos-aat.service.core-compute-aat.internal'
DOCUMENT_MANAGEMENT_URL: 'https://ccd-case-document-am-api-prl-ccd-definitions-pr-2429.preview.platform.hmcts.net'
COS_URL: 'https://prl-cos-pr-2740.preview.platform.hmcts.net'
REASONABLE_ADJUSTMENTS: 'https://cui-ra.aat.platform.hmcts.net'
FACT_URL: 'http://fact-api-aat.service.core-compute-aat.internal'
REDIS_HOST: 'prl-citizen-frontend-secondary-redis-{{ .Values.global.environment }}.redis.cache.windows.net'
Expand Down
6 changes: 3 additions & 3 deletions config/development.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ services:
citizen:
uploadDocsEmail: UPLOAD_DOCUMENTS_EMAIL
case:
url: 'http://ccd-data-store-api-aat.service.core-compute-aat.internal'
url: 'https://ccd-data-store-api-prl-ccd-definitions-pr-2429.preview.platform.hmcts.net'
cos:
url: 'http://prl-cos-aat.service.core-compute-aat.internal'
url: 'https://prl-cos-pr-2740.preview.platform.hmcts.net'
documentManagement:
url: 'http://ccd-case-document-am-api-aat.service.core-compute-aat.internal'
url: 'https://ccd-case-document-am-api-prl-ccd-definitions-pr-2429.preview.platform.hmcts.net'
fact:
url: 'http://fact-api-aat.service.core-compute-aat.internal'
reasonableAdjustments:
Expand Down
5 changes: 5 additions & 0 deletions src/main/app/case/case.ts
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,8 @@ export interface Case {
citizenUserPhoneNumberText?: string;
citizenUserDateOfBirth?: CaseDate;
citizenUserDateOfBirthText?: string;
citizenUserLivingInRefugeText?: string;
refugeDocumentText?: string;
applicant1Occupation?: string;
citizenUserSelectAddress?: string;
citizenUserPlaceOfBirth?: string;
Expand All @@ -475,6 +477,7 @@ export interface Case {
citizenUserManualAddressTown?: string;
citizenUserManualAddressCounty?: string;
citizenUserManualAddressPostcode?: string;
isCitizenLivingInRefuge?: YesOrNo;

//applicant1LanguagePreference?: LanguagePreference;
//support you need during the case
Expand Down Expand Up @@ -691,6 +694,8 @@ export interface Case {
awp_supportingDocuments?: DocumentInfo[];
awp_applicationType?: AWPApplicationType;
awp_applicationReason?: AWPApplicationReason;
refugeDocument?: Document;
reUploadRefugeDocument?: YesOrNo;
}

export interface CitizenNotification {
Expand Down
13 changes: 10 additions & 3 deletions src/main/app/case/definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ export interface PartyDetails {
contactPreferences?: ContactPreference | null;
isRemoveLegalRepresentativeRequested?: YesOrNo;
partyId: string;
liveInRefuge: YesOrNo;
refugeConfidentialityC8Form?: Document | null;
}

export interface User {
Expand Down Expand Up @@ -672,6 +674,8 @@ export type C100Applicant = {
applicantAddressTown?: string;
applicantAddressCounty?: string;
country?: string;
liveInRefuge?: YesOrNo;
refugeConfidentialityC8Form?: Document;
applicantAddressHistory?: YesOrNo;
applicantProvideDetailsOfPreviousAddresses?: string;
personalDetails: {
Expand All @@ -696,12 +700,12 @@ export interface RelationshipToChildren {
}

export interface ContactDetail {
canProvideEmail?: YesNoEmpty;
canProvideEmail?: YesOrNo | null;
emailAddress?: string;
canProvideTelephoneNumber?: YesNoEmpty;
canProvideTelephoneNumber?: YesOrNo | null;
telephoneNumber?: string;
canNotProvideTelephoneNumberReason?: string;
canLeaveVoiceMail?: YesNoEmpty;
canLeaveVoiceMail?: YesOrNo | null;
applicantContactPreferences?: string;
}

Expand Down Expand Up @@ -2767,6 +2771,8 @@ export type C100RebuildPartyDetails = {
donKnowTelephoneNumber?: YesOrNo;
};
addressUnknown?: YesOrNo;
liveInRefuge?: YesOrNo;
refugeConfidentialityC8Form?: Document;
};

export interface RelationshipToChildren {
Expand Down Expand Up @@ -2965,6 +2971,7 @@ export enum PaymentErrorContext {
export enum RootContext {
C100_REBUILD = 'c100-rebuild',
RESPONDENT = 'respondent',
APPLICANT = 'applicant'
}

export enum DomesticAbuseExemptions {
Expand Down
2 changes: 2 additions & 0 deletions src/main/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { routeGuard } from './steps/application-within-proceedings/routeGuard';
import { processAWPApplication } from './steps/application-within-proceedings/utils';
import CaseDataController from './steps/common/CaseDataController';
import DownloadDocumentController from './steps/common/documents/download/DownloadDocumentController';
import { C8RefugeSequence } from './steps/common/refuge/sequence';
import { AohSequence } from './steps/common/safety-concerns/sequence';
import CaseDetailsGetController from './steps/common/task-list/controllers/CaseDetailsGetController';
import TaskListGetController from './steps/common/task-list/controllers/TaskListGetController';
Expand Down Expand Up @@ -110,6 +111,7 @@ export class Routes {
...stepsWithContent,
...getStepsWithContent(AohSequence.getSequence(), '/common'),
...getStepsWithContent(await RAProvider.getSequence(), '/common'),
...getStepsWithContent(C8RefugeSequence.getSequence(), '/common'),
];

for (const step of steps) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ const en = {
citizenUserFullName: 'Name',
citizenUserDateOfBirthText: 'Date of birth',
citizenUserPlaceOfBirthText: 'Place of birth',
citizenUserLivingInRefugeText: 'Living in refuge',
refugeDocumentText: 'C8 refuge document',
citizenUserAddressText: 'Address',
citizenUserAddressHistory: 'Address history',
citizenUserPhoneNumberText: 'Phone number',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,12 @@ export default class AddApplicantPostController extends PostController<AnyObject
applicantPlaceOfBirth: '',
},
applicantContactDetail: {
canProvideEmail: YesNoEmpty.EMPTY,
canProvideEmail: null,
emailAddress: '',
canProvideTelephoneNumber: YesNoEmpty.EMPTY,
canProvideTelephoneNumber: null,
telephoneNumber: '',
canNotProvideTelephoneNumberReason: '',
canLeaveVoiceMail: YesNoEmpty.EMPTY,
canLeaveVoiceMail: null,
},
reasonableAdjustmentsFlags: [],
} as C100Applicant;
Expand Down
26 changes: 13 additions & 13 deletions src/main/steps/c100-rebuild/applicant/contact-detail/content.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { CaseWithId } from '../../../../app/case/case';
import { C100Applicant, YesNoEmpty } from '../../../../app/case/definition';
import { C100Applicant, YesOrNo } from '../../../../app/case/definition';
import { TranslationFn } from '../../../../app/controller/GetController';
import { FormContent, GenerateDynamicFormFields } from '../../../../app/form/Form';
import { isAlphaNumeric, isEmailValid, isFieldFilledIn, isPhoneNoValid } from '../../../../app/form/validation';
Expand Down Expand Up @@ -133,8 +133,8 @@ export const generateFormFields = (
values: [
{
label: l => l.canProvideEmailLabel,
selected: canProvideEmail === YesNoEmpty.YES,
value: YesNoEmpty.YES,
selected: canProvideEmail === YesOrNo.YES,
value: YesOrNo.YES,
subFields: {
emailAddress: {
type: 'text',
Expand All @@ -147,8 +147,8 @@ export const generateFormFields = (
},
{
label: l => l.canNotProvideEmailLabel,
selected: canProvideEmail === YesNoEmpty.NO,
value: YesNoEmpty.NO,
selected: canProvideEmail === YesOrNo.NO,
value: YesOrNo.NO,
},
],
validator: isFieldFilledIn,
Expand All @@ -159,8 +159,8 @@ export const generateFormFields = (
values: [
{
label: l => l.canProvideTelephoneNumberLabel,
selected: canProvideTelephoneNumber === YesNoEmpty.YES,
value: YesNoEmpty.YES,
selected: canProvideTelephoneNumber === YesOrNo.YES,
value: YesOrNo.YES,
subFields: {
telephoneNumber: {
type: 'text',
Expand All @@ -173,8 +173,8 @@ export const generateFormFields = (
},
{
label: l => l.canNotProvideTelephoneNumberLabel,
selected: canProvideTelephoneNumber === YesNoEmpty.NO,
value: YesNoEmpty.NO,
selected: canProvideTelephoneNumber === YesOrNo.NO,
value: YesOrNo.NO,
subFields: {
canNotProvideTelephoneNumberReason: {
type: 'text',
Expand All @@ -197,13 +197,13 @@ export const generateFormFields = (
values: [
{
label: l => l.voiceMailYesLabel,
selected: canLeaveVoiceMail === YesNoEmpty.YES,
value: YesNoEmpty.YES,
selected: canLeaveVoiceMail === YesOrNo.YES,
value: YesOrNo.YES,
},
{
label: l => l.voiceMailNoLabel,
selected: canLeaveVoiceMail === YesNoEmpty.NO,
value: YesNoEmpty.NO,
selected: canLeaveVoiceMail === YesOrNo.NO,
value: YesOrNo.NO,
},
],
validator: isFieldFilledIn,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import autobind from 'autobind-decorator';
import { Response } from 'express';

import { C100Applicant, YesNoEmpty } from '../../../../app/case/definition';
import { C100Applicant, YesOrNo } from '../../../../app/case/definition';
import { AppRequest } from '../../../../app/controller/AppRequest';
import { AnyObject, PostController } from '../../../../app/controller/PostController';
import { Form, FormFields, FormFieldsFn } from '../../../../app/form/Form';
Expand All @@ -24,12 +24,12 @@ export default class ContactDetailPostController extends PostController<AnyObjec
const applicantIndex = req.session.userCase?.appl_allApplicants?.findIndex(i => i.id === applicantId) as number;
req.session.userCase.appl_allApplicants![applicantIndex].applicantContactDetail = {
...req.session.userCase?.appl_allApplicants?.[applicantIndex].applicantContactDetail,
canProvideEmail: req.body['canProvideEmail'] as YesNoEmpty,
emailAddress: formData['canProvideEmail'] === YesNoEmpty.NO ? '' : (req.body['emailAddress'] as string),
canProvideTelephoneNumber: req.body['canProvideTelephoneNumber'] as YesNoEmpty,
canProvideEmail: req.body['canProvideEmail'] as YesOrNo,
emailAddress: formData['canProvideEmail'] === YesOrNo.NO ? '' : (req.body['emailAddress'] as string),
canProvideTelephoneNumber: req.body['canProvideTelephoneNumber'] as YesOrNo,
telephoneNumber: req.body['telephoneNumber'] as string,
canNotProvideTelephoneNumberReason: req.body['canNotProvideTelephoneNumberReason'] as YesNoEmpty,
canLeaveVoiceMail: req.body['canLeaveVoiceMail'] as YesNoEmpty,
canNotProvideTelephoneNumberReason: req.body['canNotProvideTelephoneNumberReason'] as YesOrNo,
canLeaveVoiceMail: req.body['canLeaveVoiceMail'] as YesOrNo,
};
if (onlycontinue) {
req.session.errors = form.getErrors(formData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ describe('ApplicantDetailsNavigationController', () => {
).toBe('/c100-rebuild/applicant/2cd885a0-135e-45f1-85b7-aa46a1f78f46/contact-preference');
});

test('From RELATIONSHIP CHILD screen -> navigate to ADDRESS LOOKUP screen', async () => {
test('From RELATIONSHIP CHILD screen -> navigate to refuge screen', async () => {
dummyRequest.params.childId = '7483640e-0817-4ddc-b709-6723f7925635';
dummyRequest.params.applicantId = '2cd885a0-135e-45f1-85b7-aa46a1f78f46';
expect(
Expand All @@ -105,7 +105,7 @@ describe('ApplicantDetailsNavigationController', () => {
dummyRequest.session.userCase,
dummyRequest.params
)
).toBe('/c100-rebuild/applicant/2cd885a0-135e-45f1-85b7-aa46a1f78f46/address/lookup');
).toBe('/c100-rebuild/refuge/staying-in-refuge/2cd885a0-135e-45f1-85b7-aa46a1f78f46?');
});

test('From CONFIDENTIALITY START ALT -> navigate to FEEDBACK screen', async () => {
Expand Down
8 changes: 5 additions & 3 deletions src/main/steps/c100-rebuild/applicant/navigationController.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Case } from '../../../app/case/case';
import { C100Applicant, ChildrenDetails, YesOrNo } from '../../../app/case/definition';
import { C100Applicant, ChildrenDetails, RootContext, YesOrNo } from '../../../app/case/definition';
import { applyParms } from '../../common/url-parser';
import {
C100_APPLICANTS_PERSONAL_DETAILS,
Expand All @@ -16,6 +16,7 @@ import {
C100_APPLICANT_RELATIONSHIP_TO_CHILD,
C100_RESPONDENT_DETAILS_ADD,
PageLink,
STAYING_IN_REFUGE,
} from '../../urls';
import { getPartyDetails } from '../people/util';

Expand Down Expand Up @@ -94,8 +95,9 @@ class ApplicantNavigationController {
applicantId: this.applicantId,
childId: nextChild?.id,
})
: applyParms(C100_APPLICANT_ADDRESS_LOOKUP, {
applicantId: this.applicantId,
: applyParms(STAYING_IN_REFUGE, {
root: RootContext.C100_REBUILD,
id: this.applicantId,
});
break;
}
Expand Down
16 changes: 15 additions & 1 deletion src/main/steps/c100-rebuild/c100sequence.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ describe('C100Sequence', () => {
);
expect(C100Sequence[91].showInSection).toBe('c100');
expect(C100Sequence[91].getNextStep(otherPersonMockData.session.userCase, otherPersonMockData)).toBe(
'/c100-rebuild/other-person-details/7228444b-ef3f-4202-a1e7-cdcd2316e1f6/address/lookup'
'/c100-rebuild/refuge/staying-in-refuge/7228444b-ef3f-4202-a1e7-cdcd2316e1f6?'
);

expect(C100Sequence[92].url).toBe('/c100-rebuild/child-details/:childId/live-with/mainly-live-with');
Expand Down Expand Up @@ -569,5 +569,19 @@ describe('C100Sequence', () => {
expect(C100Sequence[99].url).toBe('/c100-rebuild/check-your-answers');
expect(C100Sequence[99].showInSection).toBe('c100');
expect(C100Sequence[99].getNextStep({})).toBe('/c100-rebuild/check-your-answers');

expect(C100Sequence[100].url).toBe('/c100-rebuild/applicant/:applicantId/contact-preference');
expect(C100Sequence[100].showInSection).toBe('c100');
expect(C100Sequence[100].getNextStep(applicantMockRequest.session.userCase, applicantMockRequest)).toBe(
'/c100-rebuild/applicant/2cd885a0-135e-45f1-85b7-aa46a1f78f46/confidentiality/details-know'
);

expect(C100Sequence[101].url).toBe('/c100-rebuild/:caseId/withdraw');
expect(C100Sequence[101].showInSection).toBe('c100');
expect(C100Sequence[101].getNextStep({})).toBe('/task-list/applicant');

expect(C100Sequence[102].url).toBe('/c100-rebuild/withdraw/confirmation');
expect(C100Sequence[102].showInSection).toBe('c100');
expect(C100Sequence[102].getNextStep({})).toBe('/');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,33 @@ describe('DocumentUpload Get Controller', () => {
// expect(req.session.paymentError).toStrictEqual({ hasError: true, errorContext: 'defaultPaymentError' });
// });

test('should save errors when refuge is yes but documents not present', async () => {
req.session.userCase = {
...req.session.userCase,
appl_allApplicants: [
{
id: '6b792169-84df-4e9a-8299-c2c77c9b7e58',
applicantFirstName: 'Test',
applicantLastName: 'Applicant',
liveInRefuge: 'Yes',
},
],
oprs_otherPersons: [
{
id: '6b792169-84df-4e9a-8299-c2c77c9b7e58',
firstName: 'Test',
lastName: 'Other',
liveInRefuge: 'Yes',
},
],
};
req.locals.C100Api.saveC100DraftApplication = jest.fn();
updateCaserMock.mockResolvedValue(req.session.userCase);

await controller.get(req, res);
expect(req.session.save).toHaveBeenCalled();
});

test('should catch errors and set payment error for successful payment', async () => {
req.session.userCase.paymentSuccessDetails = {
amount: 'MOCK_AMOUNT',
Expand All @@ -104,7 +131,7 @@ describe('DocumentUpload Get Controller', () => {
payment_group_reference: 'PAYMENT_GROUP_REFERENCE',
};
req.session.paymentError = { hasError: false, errorContext: null };
req.locals.C100Api.updateCase.mockImplementation(() => {
req.locals.C100Api.saveC100DraftApplication.mockImplementation(() => {
throw new Error();
});

Expand Down
Loading