Skip to content

Commit

Permalink
Merge branch 'main-iterations' into chore/EMS-3828
Browse files Browse the repository at this point in the history
  • Loading branch information
ttbarnes committed Sep 26, 2024
2 parents c477c5e + e46af91 commit 18c6c48
Show file tree
Hide file tree
Showing 10 changed files with 2,477 additions and 2,454 deletions.
1 change: 1 addition & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"Bloggs",
"BLPU",
"BUKB",
"CABEI",
"centralised",
"CICD",
"CILC",
Expand Down
13 changes: 13 additions & 0 deletions e2e-tests/commands/insurance/check-export-contract-summary-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,19 @@ const checkExportContractSummaryList = {
cy.assertSummaryListRowDoesNotExist(summaryList, fieldId);
}
},
[FIXED_SUM_CURRENCY_CODE]: ({ shouldRender = false }) => {
const fieldId = FIXED_SUM_CURRENCY_CODE;

if (shouldRender) {
const { expectedKey, expectedChangeLinkText } = getSummaryListField(fieldId, FIELDS.AGENT_CHARGES);

const expectedValue = application.EXPORT_CONTRACT.AGENT_CHARGES[fieldId];

cy.assertSummaryListRow(summaryList, fieldId, expectedKey, expectedValue, expectedChangeLinkText);
} else {
cy.assertSummaryListRowDoesNotExist(summaryList, fieldId);
}
},
[FIXED_SUM_AMOUNT]: ({ shouldRender = false, agentChargeFixedSumAmount }) => {
const fieldId = FIXED_SUM_AMOUNT;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ export const EXPORT_CONTRACT_FIELDS = {
},
[CURRENCY_CODE]: {
LEGEND: 'What currency is the agent charging you in?',
SUMMARY: {
TITLE: "Currency of the agent's charge",
FORM_TITLE: EXPORT_CONTRACT_FORM_TITLES.AGENT,
},
},
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const {
USING_AGENT,
AGENT_DETAILS: { NAME, FULL_ADDRESS, COUNTRY_CODE },
AGENT_SERVICE: { IS_CHARGING, SERVICE_DESCRIPTION },
AGENT_CHARGES: { FIXED_SUM_AMOUNT, PERCENTAGE_CHARGE, PAYABLE_COUNTRY_CODE },
AGENT_CHARGES: { FIXED_SUM_AMOUNT, FIXED_SUM_CURRENCY_CODE, PERCENTAGE_CHARGE, PAYABLE_COUNTRY_CODE },
} = FIELD_IDS;

/**
Expand Down Expand Up @@ -68,6 +68,10 @@ const assertFullyPopulatedExportContractSummaryListRows = ({ agentChargeMethodFi
});

if (agentChargeMethodFixedSum) {
it(`should render a ${FIXED_SUM_CURRENCY_CODE} summary list row`, () => {
checkSummaryList[FIXED_SUM_CURRENCY_CODE]({ shouldRender: true });
});

it(`should render a ${FIXED_SUM_AMOUNT} summary list row`, () => {
checkSummaryList[FIXED_SUM_AMOUNT]({ shouldRender: true, agentChargeFixedSumAmount });
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const {
USING_AGENT,
AGENT_DETAILS: { NAME, FULL_ADDRESS, COUNTRY_CODE },
AGENT_SERVICE: { IS_CHARGING, SERVICE_DESCRIPTION },
AGENT_CHARGES: { FIXED_SUM_AMOUNT, PERCENTAGE_CHARGE, PAYABLE_COUNTRY_CODE },
AGENT_CHARGES: { FIXED_SUM_AMOUNT, FIXED_SUM_CURRENCY_CODE, PERCENTAGE_CHARGE, PAYABLE_COUNTRY_CODE },
} = FIELD_IDS;

const { OPEN_TENDER } = FIELDS.HOW_WAS_THE_CONTRACT_AWARDED[AWARD_METHOD].OPTIONS;
Expand Down Expand Up @@ -72,6 +72,10 @@ const assertMinimalExportContractSummaryListRows = ({ awardMethodValue = OPEN_TE
checkSummaryList[IS_CHARGING]({ shouldRender: false });
});

it(`should NOT render a ${FIXED_SUM_CURRENCY_CODE} summary list row`, () => {
checkSummaryList[FIXED_SUM_CURRENCY_CODE]({ shouldRender: false });
});

it(`should NOT render a ${FIXED_SUM_AMOUNT} summary list row`, () => {
checkSummaryList[FIXED_SUM_AMOUNT]({ shouldRender: false });
});
Expand Down
Loading

0 comments on commit 18c6c48

Please sign in to comment.