Skip to content

Commit

Permalink
CIV-15745 Fix payload for non carm response (#5027)
Browse files Browse the repository at this point in the history
* fix payload for non carm response

* fix payload for carm response

* fix date logic for test setup
  • Loading branch information
sankaviv1 authored Nov 5, 2024
1 parent 28683b5 commit 059ce94
Show file tree
Hide file tree
Showing 8 changed files with 154 additions and 49 deletions.
2 changes: 1 addition & 1 deletion e2e/api/steps_LRspec.js
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ module.exports = {

await adjustCaseSubmittedDateForCarm(caseId, carmEnabled);
const isMintiToggleEnabled = await checkMintiToggleEnabled();
await adjustCaseSubmittedDateForMinti(caseId, (isMintiToggleEnabled && isMintiCase));
await adjustCaseSubmittedDateForMinti(caseId, (isMintiToggleEnabled && isMintiCase), carmEnabled);

return caseId;
},
Expand Down
2 changes: 1 addition & 1 deletion e2e/api/steps_LRspecCui.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ module.exports = {
await adjustCaseSubmittedDateForCarm(caseId, carmEnabled);
if (isMintiCase) {
const isMintiToggleEnabled = await checkMintiToggleEnabled();
await adjustCaseSubmittedDateForMinti(caseId, (isMintiToggleEnabled && isMintiCase));
await adjustCaseSubmittedDateForMinti(caseId, (isMintiToggleEnabled && isMintiCase), carmEnabled);
}
return caseId;
},
Expand Down
10 changes: 8 additions & 2 deletions e2e/api/steps_LRspecSmall.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const data = {
CREATE_CLAIM_HEARINGS: (scenario, pbaV3) => claimDataHearings.createClaim(scenario, pbaV3),
DEFENDANT_RESPONSE: (response, camundaEvent) => require('../fixtures/events/defendantResponseSpecSmall.js').respondToClaim(response, camundaEvent),
DEFENDANT_RESPONSE_JUDICIAL_REFERRAL: () => require('../fixtures/events/defendantResponseSpecSmall.js').respondToClaimForJudicialReferral(),
DEFENDANT_RESPONSE_FULL_DEFENCE_CARM: () => require('../fixtures/events/defendantResponseSpecSmall.js').respondToClaimForCarm(),
DEFENDANT_RESPONSE_1v2: (response, camundaEvent) => require('../fixtures/events/defendantResponseSpec1v2.js').respondToClaim(response, camundaEvent),
DEFENDANT_RESPONSE2_1V2_2ND_DEF: (response) => require('../fixtures/events/defendantResponseSpecSmall.js').respondToClaim2(response),
CLAIMANT_RESPONSE: (hasAgreedFreeMediation, carmEnabled) => require('../fixtures/events/claimantResponseSpecSmall.js').claimantResponse(hasAgreedFreeMediation, carmEnabled),
Expand Down Expand Up @@ -70,7 +71,8 @@ const eventData = {
PART_ADMISSION_PBAv3: data.DEFENDANT_RESPONSE('FULL_ADMISSION', 'CREATE_CLAIM_SPEC_AFTER_PAYMENT'),
COUNTER_CLAIM: data.DEFENDANT_RESPONSE('COUNTER_CLAIM'),
COUNTER_CLAIM_PBAv3: data.DEFENDANT_RESPONSE('COUNTER_CLAIM', 'CREATE_CLAIM_SPEC_AFTER_PAYMENT'),
FULL_DEFENCE_JUDICIAL_REFERRAL: data.DEFENDANT_RESPONSE_JUDICIAL_REFERRAL()
FULL_DEFENCE_JUDICIAL_REFERRAL: data.DEFENDANT_RESPONSE_JUDICIAL_REFERRAL(),
FULL_DEFENCE_CARM: data.DEFENDANT_RESPONSE_FULL_DEFENCE_CARM()
},
ONE_V_TWO: {
FULL_ADMISSION: data.DEFENDANT_RESPONSE_1v2('FULL_ADMISSION'),
Expand Down Expand Up @@ -186,7 +188,7 @@ module.exports = function (){
return apiRequest.taskActionByUser(user, taskId, 'complete');
},

defendantResponse: async (user, response = 'FULL_DEFENCE', scenario = 'ONE_V_ONE', judicialReferral = false) => {
defendantResponse: async (user, response = 'FULL_DEFENCE', scenario = 'ONE_V_ONE', judicialReferral = false, carmEnabled = false) => {
await apiRequest.setupTokens(user);

const pbaV3 = await checkToggleEnabled(PBAv3);
Expand All @@ -210,6 +212,10 @@ module.exports = function (){
}
}

if (carmEnabled) {
defendantResponseData = eventData['defendantResponses'][scenario]['FULL_DEFENCE_CARM'];
}

caseData = returnedCaseData;

caseData = await addFlagsToFixture(caseData);
Expand Down
30 changes: 0 additions & 30 deletions e2e/fixtures/events/cui/defendantResponseCui.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,36 +234,6 @@ module.exports = {
},
respondent1ResponseLanguage: 'ENGLISH',
},
respondent1LiPResponseCarm: {
isMediationPhoneCorrect: 'No',
alternativeMediationTelephone: '01632960001',
isMediationEmailCorrect: 'No',
alternativeMediationEmail: '[email protected]',
hasUnavailabilityNextThreeMonths: 'Yes',
unavailableDatesForMediation: [
{
id: '8f76a758-733b-42c0-95b9-69b3ee2b7e6a',
value: {
who: 'defendant',
date: '2024-01-01',
fromDate: '2024-01-01',
unavailableDateType: 'SINGLE_DATE'
}
},
{
id: '38abd745-a52f-4ec1-86a9-2e2457b2f28b',
value: {
who: 'defendant',
date: '2024-03-13',
toDate: '2024-03-23',
fromDate: '2024-03-13',
unavailableDateType: 'DATE_RANGE'
}
}
],
isMediationContactNameCorrect: 'No',
alternativeMediationContactPerson: 'aaa'
},
detailsOfWhyDoesYouDisputeTheClaim: 'Testreason',
specClaimResponseTimelineList: 'MANUAL',
specResponseTimelineOfEvents: [],
Expand Down
139 changes: 138 additions & 1 deletion e2e/fixtures/events/defendantResponseSpecSmall.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const {listElement, element} = require('../../api/dataHelper');
const {listElement, element, date} = require('../../api/dataHelper');
const config = require('../../config.js');
module.exports = {
respondToClaim: (response = 'FULL_DEFENCE', camundaEvent = 'CREATE_CLAIM_SPEC') => {
Expand Down Expand Up @@ -352,6 +352,143 @@ module.exports = {
};
},

respondToClaimForCarm: () => {
return {
userInput: {
ResponseConfirmNameAddress: {
specAoSApplicantCorrespondenceAddressRequired: 'Yes',
},
ResponseConfirmDetails: {
specAoSRespondentCorrespondenceAddressRequired: 'Yes'
},
RespondentResponseTypeSpec: {
respondent1ClaimResponseTypeForSpec: 'FULL_DEFENCE'
},
defenceRoute: {
defenceRouteRequired: 'DISPUTES_THE_CLAIM'
},
Upload: {
detailsOfWhyDoesYouDisputeTheClaim: 'details'
},
HowToAddTimeline: {
specClaimResponseTimelineList: 'MANUAL'
},
MediationContactInformation:{
resp1MediationContactInfo: {
firstName:'John',
lastName: 'Maverick',
emailAddress:'[email protected]',
telephoneNumber:'07111111111'
}
},
MediationAvailability: {
resp1MediationAvailability: {
isMediationUnavailablityExists: 'Yes',
unavailableDatesForMediation: [
element({
unavailableDateType: 'SINGLE_DATE',
date: date(10)
}),
element({
unavailableDateType: 'SINGLE_DATE',
date: date(55)
}),
element({
fromDate: date(30),
toDate: date(35),
unavailableDateType: 'DATE_RANGE',
}),
element({
fromDate: date(40),
toDate: date(45),
unavailableDateType: 'DATE_RANGE',
})
]
}
},
SmallClaimExperts: {
respondent1DQExperts: {
expertRequired: 'Yes',
expertReportsSent: 'NOT_OBTAINED',
jointExpertSuitable: 'Yes',
details: [
element({
firstName: 'John',
lastName: 'Doe',
emailAddress: '[email protected]',
phoneNumber: '07111111111',
fieldOfExpertise: 'None',
whyRequired: 'Testing',
estimatedCost: '10000'
})
]
}
},
SmallClaimWitnesses: {
respondent1DQWitnessesSmallClaim: {
witnessesToAppear: 'Yes',
details: [
element({
firstName: 'Witness',
lastName: 'One',
emailAddress: '[email protected]',
phoneNumber: '07116778998',
reasonForWitness: 'None'
})
]
}
},
Language: {
respondent1DQLanguage: {
court: 'ENGLISH',
documents: 'ENGLISH'
}
},
SmallClaimHearing: {
respondent1DQHearingSmallClaim: {
unavailableDatesRequired: 'No'
},
SmallClaimHearingInterpreterRequired: 'No'
},
RequestedCourtLocationLRspec: {
respondToCourtLocation: {
responseCourtLocations: {
list_items: [
listElement(config.defendantSelectedCourt)
],
value: listElement(config.defendantSelectedCourt)
},
reasonForHearingAtSpecificCourt: 'Reasons'
}
},
HearingSupport: {
respondent1DQHearingSupport: {
supportRequirements: 'Yes',
supportRequirementsAdditional: 'Sir John Doe: Step free wheelchair access'
}
},
VulnerabilityQuestions: {
respondent1DQVulnerabilityQuestions: {
vulnerabilityAdjustmentsRequired: 'No'
}
},
StatementOfTruth: {
uiStatementOfTruth: {
name: 'name',
role: 'role'
}
}
},
midEventData: {
StatementOfTruth: {
respondent1DQHearing: {
unavailableDatesRequired: 'No'
}
}
}
};
},

respondToClaim2: (response = 'FULL_DEFENCE') => {
const responseData = {
userInput: {
Expand Down
8 changes: 1 addition & 7 deletions e2e/helpers/carmHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@ const testingSupport = require('./../api/testingSupport');

module.exports = {
adjustCaseSubmittedDateForCarm: async (caseId, carmEnabled = false, isMintiEnabled = false) => {
if (carmEnabled) {
console.log('carm enabled, updating submitted date');
await apiRequest.setupTokens(config.systemupdate);
const submittedDate = {'submittedDate':'2024-11-10T15:59:50'};
await testingSupport.updateCaseData(caseId, submittedDate);
console.log('submitted date update to after carm date');
} else if (!carmEnabled && !isMintiEnabled) {
if (!carmEnabled && !isMintiEnabled) {
console.log('carm not enabled, minti not enabled updating submitted date');
await apiRequest.setupTokens(config.systemupdate);
const submittedDate = {'submittedDate':'2024-10-10T15:59:50'};
Expand Down
6 changes: 3 additions & 3 deletions e2e/helpers/mintiHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,17 @@ module.exports = {
caseData.valid.References.submittedDate = '2025-02-20T15:59:50';
return caseData;
},
adjustCaseSubmittedDateForMinti: async (caseId, isMintiEnabled = false) => {
adjustCaseSubmittedDateForMinti: async (caseId, isMintiEnabled = false, isCarmEnabled = false) => {
if (isMintiEnabled) {
console.log('multi Intermediate track is enabled');
await apiRequest.setupTokens(config.systemupdate);
const submittedDate = {'submittedDate':'2025-02-20T15:59:50'};
await testingSupport.updateCaseData(caseId, submittedDate);
console.log('submitted date update to after multi Intermediate track live date');
} else {
} else if (!isMintiEnabled && !isCarmEnabled) {
console.log('multi Intermediate track not enabled, updating submitted date');
await apiRequest.setupTokens(config.systemupdate);
const submittedDate = {'submittedDate':'2022-05-10T15:59:50'};
const submittedDate = {'submittedDate':'2024-10-28T15:59:50'};
await testingSupport.updateCaseData(caseId, submittedDate);
console.log('submitted date update to before multi Intermediate track live date');
}
Expand Down
6 changes: 2 additions & 4 deletions e2e/tests/api_tests/lrspec/api_1v1_spec_small_test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


const config = require('../../../config.js');
const {checkCarmToggleEnabled} = require('../../../api/testingSupport');

Expand Down Expand Up @@ -32,8 +30,8 @@ Scenario('1v1 COUNTER_CLAIM claimant and defendant response small claim', async

Scenario('1v1 FULL_DEFENCE claimant and defendant response small claim - CARM enabled', async ({I, api_spec_small}) => {
if (await checkCarmToggleEnabled()) {
await api_spec_small.createClaimWithRepresentedRespondent(config.applicantSolicitorUser);
await api_spec_small.defendantResponse(config.defendantSolicitorUser, 'FULL_DEFENCE');
await api_spec_small.createClaimWithRepresentedRespondent(config.applicantSolicitorUser, 'ONE_V_ONE', false, true);
await api_spec_small.defendantResponse(config.defendantSolicitorUser, 'FULL_DEFENCE', 'ONE_V_ONE', false, true);
await api_spec_small.claimantResponse(config.applicantSolicitorUser, true, 'No', true);
await api_spec_small.manageContactInformation(config.adminUser, true);
}
Expand Down

0 comments on commit 059ce94

Please sign in to comment.