From e6d5b715d750868231a0a5b1a9699f4182bb9b8d Mon Sep 17 00:00:00 2001 From: Zain Kassam Date: Thu, 20 Jun 2024 12:57:15 +0100 Subject: [PATCH] feat(EMS-3454): changed to alternativeCurrency in relevant files --- ...omplete-and-submit-multiple-contract-policy-form.js | 6 +++--- .../complete-and-submit-single-contract-policy-form.js | 6 +++--- .../insurance/complete-and-submit-turnover-form.js | 6 +++--- .../commands/insurance/complete-business-section.js | 2 +- .../complete-multiple-contract-policy-form.js | 10 +++------- .../commands/insurance/complete-policy-section.js | 8 ++++---- ...prepare-application-section-multiple-policy-type.js | 2 +- ...e-prepare-application-section-single-policy-type.js | 2 +- .../insurance/complete-single-contract-policy-form.js | 6 +++--- ...ltiple-contract-policy-alternative-currency.spec.js | 2 +- ...single-contract-policy-alternative-currency.spec.js | 2 +- ...ct-policy-export-value-alternative-currency.spec.js | 2 +- ...y-total-contract-value-alternative-currency.spec.js | 2 +- 13 files changed, 26 insertions(+), 30 deletions(-) diff --git a/e2e-tests/commands/insurance/complete-and-submit-multiple-contract-policy-form.js b/e2e-tests/commands/insurance/complete-and-submit-multiple-contract-policy-form.js index 4eae44be80..ecf439675f 100644 --- a/e2e-tests/commands/insurance/complete-and-submit-multiple-contract-policy-form.js +++ b/e2e-tests/commands/insurance/complete-and-submit-multiple-contract-policy-form.js @@ -2,12 +2,12 @@ * completeAndSubmitMultipleContractPolicyForm * Complete and submit the "multiple contract policy" form * @param {String} isoCode: Policy currency ISO code - * @param {Boolean} alternativeCurrencyPolicy: Select the "alternative currency" option + * @param {Boolean} alternativeCurrency: Select the "alternative currency" option */ -const completeAndSubmitMultipleContractPolicyForm = ({ isoCode, alternativeCurrencyPolicy }) => { +const completeAndSubmitMultipleContractPolicyForm = ({ isoCode, alternativeCurrency }) => { cy.completeMultipleContractPolicyForm({ isoCode, - alternativeCurrencyPolicy, + alternativeCurrency, }); cy.clickSubmitButton(); diff --git a/e2e-tests/commands/insurance/complete-and-submit-single-contract-policy-form.js b/e2e-tests/commands/insurance/complete-and-submit-single-contract-policy-form.js index 3a0b148764..f3f45a875c 100644 --- a/e2e-tests/commands/insurance/complete-and-submit-single-contract-policy-form.js +++ b/e2e-tests/commands/insurance/complete-and-submit-single-contract-policy-form.js @@ -2,12 +2,12 @@ * completeAndSubmitSingleContractPolicyForm * Complete and submit the "single contract policy" form. * @param {String} isoCode: Policy currency ISO code - * @param {Boolean} alternativeCurrencyPolicy: Select the "alternative currency" option + * @param {Boolean} alternativeCurrency: Select the "alternative currency" option */ -const completeAndSubmitSingleContractPolicyForm = ({ isoCode, alternativeCurrencyPolicy }) => { +const completeAndSubmitSingleContractPolicyForm = ({ isoCode, alternativeCurrency }) => { cy.completeSingleContractPolicyForm({ isoCode, - alternativeCurrencyPolicy, + alternativeCurrency, }); cy.clickSubmitButton(); diff --git a/e2e-tests/commands/insurance/complete-and-submit-turnover-form.js b/e2e-tests/commands/insurance/complete-and-submit-turnover-form.js index 83f0833823..2e7700a742 100644 --- a/e2e-tests/commands/insurance/complete-and-submit-turnover-form.js +++ b/e2e-tests/commands/insurance/complete-and-submit-turnover-form.js @@ -11,10 +11,10 @@ const { /** * completeAndSubmitTurnoverForm * complete and submit the "turnover" form. - * @param {Boolean} alternativeCurrencyTurnover: Select the "alternative currency" option + * @param {Boolean} alternativeCurrency: Select the "alternative currency" option */ -const completeAndSubmitTurnoverForm = ({ alternativeCurrencyTurnover = false }) => { - if (alternativeCurrencyTurnover) { +const completeAndSubmitTurnoverForm = ({ alternativeCurrency = false }) => { + if (alternativeCurrency) { cy.completeAndSubmitAlternativeCurrencyForm({ alternativeCurrency: true }); } diff --git a/e2e-tests/commands/insurance/complete-business-section.js b/e2e-tests/commands/insurance/complete-business-section.js index aa6e68ffb2..8ca5d5ef6f 100644 --- a/e2e-tests/commands/insurance/complete-business-section.js +++ b/e2e-tests/commands/insurance/complete-business-section.js @@ -25,7 +25,7 @@ const completeBusinessSection = ({ } cy.completeAndSubmitNatureOfYourBusiness(); - cy.completeAndSubmitTurnoverForm({ alternativeCurrencyTurnover }); + cy.completeAndSubmitTurnoverForm({ alternativeCurrency: alternativeCurrencyTurnover }); cy.completeAndSubmitCreditControlForm({ hasCreditControlProcess }); if (submitCheckYourAnswers) { diff --git a/e2e-tests/commands/insurance/complete-multiple-contract-policy-form.js b/e2e-tests/commands/insurance/complete-multiple-contract-policy-form.js index 76e7654cd4..a6f500d26c 100644 --- a/e2e-tests/commands/insurance/complete-multiple-contract-policy-form.js +++ b/e2e-tests/commands/insurance/complete-multiple-contract-policy-form.js @@ -18,14 +18,10 @@ const { * completeMultipleContractPolicyForm * Complete the "multiple contract policy" form * @param {String} isoCode: Policy currency ISO code - * @param {Boolean} alternativeCurrencyPolicy: Select the "alternative currency" option + * @param {Boolean} alternativeCurrency: Select the "alternative currency" option * @param {Boolean} chooseCurrency: Whether to choose a currency or not */ -const completeMultipleContractPolicyForm = ({ - isoCode = application.POLICY[POLICY_CURRENCY_CODE], - alternativeCurrencyPolicy = false, - chooseCurrency = true, -}) => { +const completeMultipleContractPolicyForm = ({ isoCode = application.POLICY[POLICY_CURRENCY_CODE], alternativeCurrency = false, chooseCurrency = true }) => { cy.keyboardInput(field(REQUESTED_START_DATE).dayInput(), application.POLICY[REQUESTED_START_DATE].day); cy.keyboardInput(field(REQUESTED_START_DATE).monthInput(), application.POLICY[REQUESTED_START_DATE].month); cy.keyboardInput(field(REQUESTED_START_DATE).yearInput(), application.POLICY[REQUESTED_START_DATE].year); @@ -33,7 +29,7 @@ const completeMultipleContractPolicyForm = ({ cy.keyboardInput(field(TOTAL_MONTHS_OF_COVER).input(), application.POLICY[TOTAL_MONTHS_OF_COVER]); if (chooseCurrency) { - if (alternativeCurrencyPolicy) { + if (alternativeCurrency) { cy.clickAlternativeCurrencyRadioAndCompleteCurrency({ currency: NON_STANDARD_CURRENCY_CODE, }); diff --git a/e2e-tests/commands/insurance/complete-policy-section.js b/e2e-tests/commands/insurance/complete-policy-section.js index f79315e15b..616aa15c64 100644 --- a/e2e-tests/commands/insurance/complete-policy-section.js +++ b/e2e-tests/commands/insurance/complete-policy-section.js @@ -9,7 +9,7 @@ const { POLICY_TYPE } = APPLICATION; * @param {String} policyType: If single or multiple policy - defaults to single * @param {Boolean} policyValueOverMvpMaximum: If the value should be over the MVP maximum amount * @param {String} isoCode: Policy currency ISO code - * @param {Boolean} alternativeCurrencyPolicy: Select the "alternative currency" option + * @param {Boolean} alternativeCurrency: Select the "alternative currency" option * @param {Boolean} sameName: If name on policy is the same as the signed in user - defaults to true * @param {Boolean} needPreCreditPeriod: If the user needs a pre-credit period - defaults to false * @param {Boolean} usingBroker: If "using broker" on - defaults to false @@ -23,7 +23,7 @@ const completePolicySection = ({ policyType = POLICY_TYPE.SINGLE, policyValueOverMvpMaximum = false, isoCode, - alternativeCurrencyPolicy = false, + alternativeCurrency = false, sameName = true, needPreCreditPeriod = false, usingBroker = false, @@ -39,14 +39,14 @@ const completePolicySection = ({ if (policyType === POLICY_TYPE.SINGLE) { cy.completeAndSubmitSingleContractPolicyForm({ isoCode, - alternativeCurrencyPolicy, + alternativeCurrency, }); cy.completeAndSubmitTotalContractValueForm({ policyValueOverMvpMaximum }); } else { cy.completeAndSubmitMultipleContractPolicyForm({ isoCode, - alternativeCurrencyPolicy, + alternativeCurrency, }); cy.completeAndSubmitExportValueForm({ policyType }); diff --git a/e2e-tests/commands/insurance/complete-prepare-application-section-multiple-policy-type.js b/e2e-tests/commands/insurance/complete-prepare-application-section-multiple-policy-type.js index 95d3fc763c..3ef9f64791 100644 --- a/e2e-tests/commands/insurance/complete-prepare-application-section-multiple-policy-type.js +++ b/e2e-tests/commands/insurance/complete-prepare-application-section-multiple-policy-type.js @@ -94,7 +94,7 @@ const completePrepareApplicationMultiplePolicyType = ({ needPreCreditPeriod, isAppointingLossPayee, lossPayeeIsLocatedInUK, - alternativeCurrencyPolicy, + alternativeCurrency: alternativeCurrencyPolicy, }); cy.completeExportContractSection({ diff --git a/e2e-tests/commands/insurance/complete-prepare-application-section-single-policy-type.js b/e2e-tests/commands/insurance/complete-prepare-application-section-single-policy-type.js index 2ba75149f0..adc6b280e2 100644 --- a/e2e-tests/commands/insurance/complete-prepare-application-section-single-policy-type.js +++ b/e2e-tests/commands/insurance/complete-prepare-application-section-single-policy-type.js @@ -94,7 +94,7 @@ const completePrepareApplicationSinglePolicyType = ({ needPreCreditPeriod, isAppointingLossPayee, lossPayeeIsLocatedInUK, - alternativeCurrencyPolicy, + alternativeCurrency: alternativeCurrencyPolicy, }); cy.completeExportContractSection({ diff --git a/e2e-tests/commands/insurance/complete-single-contract-policy-form.js b/e2e-tests/commands/insurance/complete-single-contract-policy-form.js index e2a5bf397d..36a342266c 100644 --- a/e2e-tests/commands/insurance/complete-single-contract-policy-form.js +++ b/e2e-tests/commands/insurance/complete-single-contract-policy-form.js @@ -18,10 +18,10 @@ const { * completeSingleContractPolicyForm * Complete the "single contract policy" form. * @param {String} isoCode: Policy currency ISO code - * @param {Boolean} alternativeCurrencyPolicy: Select the "alternative currency" option + * @param {Boolean} alternativeCurrency: Select the "alternative currency" option * @param {Boolean} chooseCurrency: Whether to choose a currency or not */ -const completeSingleContractPolicyForm = ({ isoCode = application.POLICY[POLICY_CURRENCY_CODE], alternativeCurrencyPolicy = false, chooseCurrency = true }) => { +const completeSingleContractPolicyForm = ({ isoCode = application.POLICY[POLICY_CURRENCY_CODE], alternativeCurrency = false, chooseCurrency = true }) => { cy.keyboardInput(field(REQUESTED_START_DATE).dayInput(), application.POLICY[REQUESTED_START_DATE].day); cy.keyboardInput(field(REQUESTED_START_DATE).monthInput(), application.POLICY[REQUESTED_START_DATE].month); cy.keyboardInput(field(REQUESTED_START_DATE).yearInput(), application.POLICY[REQUESTED_START_DATE].year); @@ -31,7 +31,7 @@ const completeSingleContractPolicyForm = ({ isoCode = application.POLICY[POLICY_ cy.keyboardInput(field(CONTRACT_COMPLETION_DATE).yearInput(), application.POLICY[CONTRACT_COMPLETION_DATE].year); if (chooseCurrency) { - if (alternativeCurrencyPolicy) { + if (alternativeCurrency) { cy.clickAlternativeCurrencyRadioOption(); cy.completeAlternativeCurrencyField({ currency: NON_STANDARD_CURRENCY_CODE }); diff --git a/e2e-tests/insurance/cypress/e2e/journeys/policy/check-your-answers/check-your-answers-summary-list/summary-list-multiple-contract-policy-alternative-currency.spec.js b/e2e-tests/insurance/cypress/e2e/journeys/policy/check-your-answers/check-your-answers-summary-list/summary-list-multiple-contract-policy-alternative-currency.spec.js index ddefc2ee6a..cbbe2c9db6 100644 --- a/e2e-tests/insurance/cypress/e2e/journeys/policy/check-your-answers/check-your-answers-summary-list/summary-list-multiple-contract-policy-alternative-currency.spec.js +++ b/e2e-tests/insurance/cypress/e2e/journeys/policy/check-your-answers/check-your-answers-summary-list/summary-list-multiple-contract-policy-alternative-currency.spec.js @@ -28,7 +28,7 @@ context('Insurance - Policy - Check your answers - Summary list - Multiple contr cy.completePolicySection({ policyType: FIELD_VALUES.POLICY_TYPE.MULTIPLE, isoCode: NON_STANDARD_CURRENCY_CODE, - alternativeCurrencyPolicy: true, + alternativeCurrency: true, }); url = `${baseUrl}${INSURANCE_ROOT}/${referenceNumber}${POLICY.CHECK_YOUR_ANSWERS}`; diff --git a/e2e-tests/insurance/cypress/e2e/journeys/policy/check-your-answers/check-your-answers-summary-list/summary-list-single-contract-policy-alternative-currency.spec.js b/e2e-tests/insurance/cypress/e2e/journeys/policy/check-your-answers/check-your-answers-summary-list/summary-list-single-contract-policy-alternative-currency.spec.js index b4d7eeb8c3..498257db4d 100644 --- a/e2e-tests/insurance/cypress/e2e/journeys/policy/check-your-answers/check-your-answers-summary-list/summary-list-single-contract-policy-alternative-currency.spec.js +++ b/e2e-tests/insurance/cypress/e2e/journeys/policy/check-your-answers/check-your-answers-summary-list/summary-list-single-contract-policy-alternative-currency.spec.js @@ -26,7 +26,7 @@ context('Insurance - Policy - Check your answers - Summary list - Single contrac cy.completePolicySection({ isoCode: NON_STANDARD_CURRENCY_CODE, - alternativeCurrencyPolicy: true, + alternativeCurrency: true, }); url = `${baseUrl}${INSURANCE_ROOT}/${referenceNumber}${POLICY.CHECK_YOUR_ANSWERS}`; diff --git a/e2e-tests/insurance/cypress/e2e/journeys/policy/multiple-contract-policy/export-value/multiple-contract-policy-export-value-alternative-currency.spec.js b/e2e-tests/insurance/cypress/e2e/journeys/policy/multiple-contract-policy/export-value/multiple-contract-policy-export-value-alternative-currency.spec.js index 39edb78182..46b393290e 100644 --- a/e2e-tests/insurance/cypress/e2e/journeys/policy/multiple-contract-policy/export-value/multiple-contract-policy-export-value-alternative-currency.spec.js +++ b/e2e-tests/insurance/cypress/e2e/journeys/policy/multiple-contract-policy/export-value/multiple-contract-policy-export-value-alternative-currency.spec.js @@ -41,7 +41,7 @@ context('Insurance - Policy - Multiple contract policy - Export value page - Alt cy.completeAndSubmitMultipleContractPolicyForm({ isoCode: NON_STANDARD_CURRENCY_CODE, - alternativeCurrencyPolicy: true, + alternativeCurrency: true, }); url = `${baseUrl}${INSURANCE_ROOT}/${referenceNumber}${MULTIPLE_CONTRACT_POLICY_EXPORT_VALUE}`; diff --git a/e2e-tests/insurance/cypress/e2e/journeys/policy/single-contract-policy/total-contract-value/single-contract-policy-total-contract-value-alternative-currency.spec.js b/e2e-tests/insurance/cypress/e2e/journeys/policy/single-contract-policy/total-contract-value/single-contract-policy-total-contract-value-alternative-currency.spec.js index 0b11c6530c..5a9f6044b0 100644 --- a/e2e-tests/insurance/cypress/e2e/journeys/policy/single-contract-policy/total-contract-value/single-contract-policy-total-contract-value-alternative-currency.spec.js +++ b/e2e-tests/insurance/cypress/e2e/journeys/policy/single-contract-policy/total-contract-value/single-contract-policy-total-contract-value-alternative-currency.spec.js @@ -37,7 +37,7 @@ context('Insurance - Policy - Single contract policy - Total contract value page cy.completeAndSubmitPolicyTypeForm({}); cy.completeAndSubmitSingleContractPolicyForm({ isoCode: NON_STANDARD_CURRENCY_CODE, - alternativeCurrencyPolicy: true, + alternativeCurrency: true, }); url = `${baseUrl}${ROOT}/${referenceNumber}${SINGLE_CONTRACT_POLICY_TOTAL_CONTRACT_VALUE}`;