Skip to content

Commit

Permalink
Merge pull request #3798 from hmcts/revert-3762-EXUI-2018
Browse files Browse the repository at this point in the history
Revert "EXUI-2018"
  • Loading branch information
StoneBenHMCTS authored Jul 12, 2024
2 parents 7f13249 + 9ca0b4b commit 9cc068b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 81 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1193,49 +1193,6 @@ describe('HearingEditSummaryComponent', () => {
});

it('should return false as no difference in reasonable adjustment', () => {
setAfterPageVisitValues();
const partiesSHV = createSHVEntry();
const partiesHMC = createHMCEntry();

component.serviceHearingValuesModel = {
...initialState.hearings.hearingValues.serviceHearingValuesModel,
parties: partiesSHV
};
component.hearingRequestMainModel = {
...initialState.hearings.hearingRequest.hearingRequestMainModel,
partyDetails: partiesHMC
};

const isDifference = component.pageVisitReasonableAdjustmentChangeExists();

expect(isDifference).toEqual(false);
});

it('should return true as reasonable adjustment required but not confirmed.', () => {
setAfterPageVisitValues();
hearingsService.propertiesUpdatedOnPageVisit.afterPageVisit.reasonableAdjustmentChangesRequired = true;

const partiesSHV = createSHVEntry();
const partiesHMC = createHMCEntry();

component.serviceHearingValuesModel = {
...initialState.hearings.hearingValues.serviceHearingValuesModel,
parties: partiesSHV
};
component.hearingRequestMainModel = {
...initialState.hearings.hearingRequest.hearingRequestMainModel,
partyDetails: partiesHMC
};

const isDifference = component.pageVisitReasonableAdjustmentChangeExists();

expect(isDifference).toEqual(true);
});

it('should return false as reasonable adjustment required and confirmed.', () => {
setAfterPageVisitValues();
hearingsService.propertiesUpdatedOnPageVisit.afterPageVisit.reasonableAdjustmentChangesRequired = true;
hearingsService.propertiesUpdatedOnPageVisit.afterPageVisit.reasonableAdjustmentChangesConfirmed = true;
const partiesSHV = createSHVEntry();
const partiesHMC = createHMCEntry();

Expand All @@ -1254,8 +1211,6 @@ describe('HearingEditSummaryComponent', () => {
});

it('should return true as there is a difference in reasonable adjustment', () => {
setAfterPageVisitValues();
hearingsService.propertiesUpdatedOnPageVisit.afterPageVisit.reasonableAdjustmentChangesRequired = true;
const partiesSHV = createSHVEntry();
const partiesHMC = createHMCEntry();
partiesHMC[1].individualDetails.reasonableAdjustments = ['RA0041', 'RA0044', 'RA0042'];
Expand All @@ -1275,7 +1230,6 @@ describe('HearingEditSummaryComponent', () => {
});

it('should return false as removed party had no reasonable adjustments', () => {
setAfterPageVisitValues();
const partiesSHV: PartyDetailsModel[] = createSHVEntry();

const partiesHMC: PartyDetailsModel[] = createHMCEntry();
Expand Down Expand Up @@ -1308,7 +1262,6 @@ describe('HearingEditSummaryComponent', () => {
});

it('should return false as removed party had no reasonable adjustments test 2', () => {
setAfterPageVisitValues();
const partiesSHV: PartyDetailsModel[] = createSHVEntry();

const partiesHMC: PartyDetailsModel[] = createHMCEntry();
Expand Down Expand Up @@ -1342,7 +1295,6 @@ describe('HearingEditSummaryComponent', () => {
});

it('should return false as added party had no reasonable adjustments', () => {
setAfterPageVisitValues();
const partiesSHV: PartyDetailsModel[] = createSHVEntry();

const partiesHMC: PartyDetailsModel[] = createHMCEntry();
Expand Down Expand Up @@ -1375,8 +1327,6 @@ describe('HearingEditSummaryComponent', () => {
});

it('should return true as party removed from original hmc with reasonable adjustment', () => {
setAfterPageVisitValues();
hearingsService.propertiesUpdatedOnPageVisit.afterPageVisit.reasonableAdjustmentChangesRequired = true;
const partiesSHV = createSHVEntry();
const partiesHMC = createHMCEntry();

Expand Down Expand Up @@ -1413,8 +1363,6 @@ describe('HearingEditSummaryComponent', () => {
});

it('should return true as party to original shv with reasonable adjustment', () => {
setAfterPageVisitValues();
hearingsService.propertiesUpdatedOnPageVisit.afterPageVisit.reasonableAdjustmentChangesRequired = true;
const partiesSHV = createSHVEntry();
const partiesHMC = createHMCEntry();

Expand Down Expand Up @@ -1531,25 +1479,4 @@ describe('HearingEditSummaryComponent', () => {
];
return partiesHMC;
}
function setAfterPageVisitValues() {
hearingsService.propertiesUpdatedOnPageVisit = {
hearingId: 'h000001',
caseFlags: null,
parties: null,
hearingWindow: null,
afterPageVisit: {
reasonableAdjustmentChangesConfirmed: false,
reasonableAdjustmentChangesRequired: false,
nonReasonableAdjustmentChangesRequired: false,
nonReasonableAdjustmentChangesConfirmed: false,
partyDetailsChangesRequired: false,
partyDetailsChangesConfirmed: true,
hearingWindowChangesRequired: false,
hearingFacilitiesChangesRequired: false,
partyDetailsAnyChangesRequired: false,
hearingUnavailabilityDatesChanged: false,
hearingWindowChangesConfirmed: false
}
};
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -459,14 +459,7 @@ export class HearingEditSummaryComponent extends RequestHearingPageFlow implemen
const interpreterLanguagesSHV = this.extractInterpreterLanguages(SHVIndividualParties);
const interpreterLanguagesHMC = this.extractInterpreterLanguages(HRMIndividualParties);

if (!_.isEqual(interpreterLanguagesSHV, interpreterLanguagesHMC)){
return true;
}
if (this.hearingsService.propertiesUpdatedOnPageVisit?.afterPageVisit?.reasonableAdjustmentChangesRequired) {
return !this.hearingsService.propertiesUpdatedOnPageVisit?.afterPageVisit?.reasonableAdjustmentChangesConfirmed;
}
// There are no changes for reasonable adjustments and language interpreter flags when SHV compared with HMC
return false;
return !_.isEqual(interpreterLanguagesSHV, interpreterLanguagesHMC);
}

private extractReasonableAdjustments(partyDetails: PartyDetailsModel[]) {
Expand Down

0 comments on commit 9cc068b

Please sign in to comment.