diff --git a/e2e-tests/insurance/cypress/e2e/journeys/check-your-answers/export-contract/change-your-answers/how-the-contract-was-awarded/change-your-answers-how-the-contract-was-awarded-from-other-method.spec.js b/e2e-tests/insurance/cypress/e2e/journeys/check-your-answers/export-contract/change-your-answers/how-the-contract-was-awarded/change-your-answers-how-the-contract-was-awarded-from-other-method.spec.js index 6336a9a399..9e735c477c 100644 --- a/e2e-tests/insurance/cypress/e2e/journeys/check-your-answers/export-contract/change-your-answers/how-the-contract-was-awarded/change-your-answers-how-the-contract-was-awarded-from-other-method.spec.js +++ b/e2e-tests/insurance/cypress/e2e/journeys/check-your-answers/export-contract/change-your-answers/how-the-contract-was-awarded/change-your-answers-how-the-contract-was-awarded-from-other-method.spec.js @@ -60,11 +60,11 @@ context( beforeEach(() => { cy.navigateToUrl(url); - // change to DIRECT_AWARD + // select DIRECT_AWARD summaryList.field(FIELD_ID).changeLink().click(); cy.completeAndSubmitHowWasTheContractAwardedForm({ directAward: true }); - // change back to OTHER + // select OTHER summaryList.field(FIELD_ID).changeLink().click(); const selector = radios(OTHER.ID).option; selector.label().click(); diff --git a/e2e-tests/insurance/cypress/e2e/journeys/check-your-answers/export-contract/summary-list/check-your-answer-summary-list-contract-awarded-competitive-bidding.spec.js b/e2e-tests/insurance/cypress/e2e/journeys/check-your-answers/export-contract/summary-list/check-your-answer-summary-list-contract-awarded-competitive-bidding.spec.js index 0aa01ba831..047fe58e3b 100644 --- a/e2e-tests/insurance/cypress/e2e/journeys/check-your-answers/export-contract/summary-list/check-your-answer-summary-list-contract-awarded-competitive-bidding.spec.js +++ b/e2e-tests/insurance/cypress/e2e/journeys/check-your-answers/export-contract/summary-list/check-your-answer-summary-list-contract-awarded-competitive-bidding.spec.js @@ -22,7 +22,7 @@ const task = taskList.submitApplication.tasks.checkAnswers; const baseUrl = Cypress.config('baseUrl'); context( - 'Insurance - Check your answers - Export contract - Summary list - Contract awarded competitive bidding - As an exporter, I want to be able to review my input for the export contract again, So that I can do a final review of the information I previously input before submitting my application', + `Insurance - Check your answers - Export contract - Summary list - Contract awarded ${COMPETITIVE_BIDDING.TEXT} - As an exporter, I want to be able to review my input for the export contract again, So that I can do a final review of the information I previously input before submitting my application`, () => { let referenceNumber; let url; diff --git a/e2e-tests/insurance/cypress/e2e/journeys/check-your-answers/export-contract/summary-list/check-your-answer-summary-list-contract-awarded-direct-award.spec.js b/e2e-tests/insurance/cypress/e2e/journeys/check-your-answers/export-contract/summary-list/check-your-answer-summary-list-contract-awarded-direct-award.spec.js index 131590af29..614427dd33 100644 --- a/e2e-tests/insurance/cypress/e2e/journeys/check-your-answers/export-contract/summary-list/check-your-answer-summary-list-contract-awarded-direct-award.spec.js +++ b/e2e-tests/insurance/cypress/e2e/journeys/check-your-answers/export-contract/summary-list/check-your-answer-summary-list-contract-awarded-direct-award.spec.js @@ -22,7 +22,7 @@ const task = taskList.submitApplication.tasks.checkAnswers; const baseUrl = Cypress.config('baseUrl'); context( - 'Insurance - Check your answers - Export contract - Summary list - Contract awarded direct award - As an exporter, I want to be able to review my input for the export contract again, So that I can do a final review of the information I previously input before submitting my application', + `Insurance - Check your answers - Export contract - Summary list - Contract awarded ${DIRECT_AWARD.TEXT} - As an exporter, I want to be able to review my input for the export contract again, So that I can do a final review of the information I previously input before submitting my application`, () => { let referenceNumber; let url; diff --git a/e2e-tests/insurance/cypress/e2e/journeys/check-your-answers/export-contract/summary-list/check-your-answer-summary-list-contract-awarded-negotiated-contract.spec.js b/e2e-tests/insurance/cypress/e2e/journeys/check-your-answers/export-contract/summary-list/check-your-answer-summary-list-contract-awarded-negotiated-contract.spec.js index 3bd39c0b32..cd60492d6f 100644 --- a/e2e-tests/insurance/cypress/e2e/journeys/check-your-answers/export-contract/summary-list/check-your-answer-summary-list-contract-awarded-negotiated-contract.spec.js +++ b/e2e-tests/insurance/cypress/e2e/journeys/check-your-answers/export-contract/summary-list/check-your-answer-summary-list-contract-awarded-negotiated-contract.spec.js @@ -22,7 +22,7 @@ const task = taskList.submitApplication.tasks.checkAnswers; const baseUrl = Cypress.config('baseUrl'); context( - 'Insurance - Check your answers - Export contract - Summary list - Contract awarded negotiated contract - As an exporter, I want to be able to review my input for the export contract again, So that I can do a final review of the information I previously input before submitting my application', + `Insurance - Check your answers - Export contract - Summary list - Contract awarded ${NEGOTIATED_CONTRACT.TEXT} - As an exporter, I want to be able to review my input for the export contract again, So that I can do a final review of the information I previously input before submitting my application`, () => { let referenceNumber; let url; diff --git a/e2e-tests/insurance/cypress/e2e/journeys/check-your-answers/export-contract/summary-list/check-your-answers-summary-list-contracted-awarded-other-method.spec.js b/e2e-tests/insurance/cypress/e2e/journeys/check-your-answers/export-contract/summary-list/check-your-answers-summary-list-contract-awarded-other-method.spec.js similarity index 73% rename from e2e-tests/insurance/cypress/e2e/journeys/check-your-answers/export-contract/summary-list/check-your-answers-summary-list-contracted-awarded-other-method.spec.js rename to e2e-tests/insurance/cypress/e2e/journeys/check-your-answers/export-contract/summary-list/check-your-answers-summary-list-contract-awarded-other-method.spec.js index 987bfc71a0..ee4d6cd5cf 100644 --- a/e2e-tests/insurance/cypress/e2e/journeys/check-your-answers/export-contract/summary-list/check-your-answers-summary-list-contracted-awarded-other-method.spec.js +++ b/e2e-tests/insurance/cypress/e2e/journeys/check-your-answers/export-contract/summary-list/check-your-answers-summary-list-contract-awarded-other-method.spec.js @@ -3,6 +3,7 @@ import { INSURANCE_ROUTES } from '../../../../../../../constants/routes/insuranc import { assertMinimalExportContractSummaryListRows } from '../../../../../../../shared-test-assertions'; import application from '../../../../../../../fixtures/application'; import FIELD_IDS from '../../../../../../../constants/field-ids/insurance/export-contract'; +import { EXPORT_CONTRACT_FIELDS as FIELDS } from '../../../../../../../content-strings/fields/insurance/export-contract'; const { ROOT: INSURANCE_ROOT, @@ -10,9 +11,11 @@ const { } = INSURANCE_ROUTES; const { - HOW_WAS_THE_CONTRACT_AWARDED: { OTHER_AWARD_METHOD }, + HOW_WAS_THE_CONTRACT_AWARDED: { OTHER_AWARD_METHOD, AWARD_METHOD }, } = FIELD_IDS; +const { OTHER } = FIELDS.HOW_WAS_THE_CONTRACT_AWARDED[AWARD_METHOD].OPTIONS; + const { taskList } = partials.insurancePartials; const task = taskList.submitApplication.tasks.checkAnswers; @@ -20,7 +23,7 @@ const task = taskList.submitApplication.tasks.checkAnswers; const baseUrl = Cypress.config('baseUrl'); context( - 'Insurance - Check your answers - Export contract - Summary list - Contract awarded other method - As an exporter, I want to be able to review my input for the export contract again, So that I can do a final review of the information I previously input before submitting my application', + `Insurance - Check your answers - Export contract - Summary list - Contract awarded ${OTHER.TEXT} - As an exporter, I want to be able to review my input for the export contract again, So that I can do a final review of the information I previously input before submitting my application`, () => { let referenceNumber; let url; diff --git a/e2e-tests/insurance/cypress/e2e/journeys/export-contract/change-your-answers/how-the-contract-was-awarded/change-your-answers-how-the-contract-was-awarded-from-other-method.spec.js b/e2e-tests/insurance/cypress/e2e/journeys/export-contract/change-your-answers/how-the-contract-was-awarded/change-your-answers-how-the-contract-was-awarded-from-other-method.spec.js index 4cb565dffa..f0df17e720 100644 --- a/e2e-tests/insurance/cypress/e2e/journeys/export-contract/change-your-answers/how-the-contract-was-awarded/change-your-answers-how-the-contract-was-awarded-from-other-method.spec.js +++ b/e2e-tests/insurance/cypress/e2e/journeys/export-contract/change-your-answers/how-the-contract-was-awarded/change-your-answers-how-the-contract-was-awarded-from-other-method.spec.js @@ -47,11 +47,11 @@ context( beforeEach(() => { cy.navigateToUrl(checkYourAnswersUrl); - // change to DIRECT_AWARD + // select DIRECT_AWARD summaryList.field(FIELD_ID).changeLink().click(); cy.completeAndSubmitHowWasTheContractAwardedForm({ directAward: true }); - // change back to OTHER + // select OTHER summaryList.field(FIELD_ID).changeLink().click(); const selector = radios(OTHER.ID).option; selector.label().click(); diff --git a/e2e-tests/insurance/cypress/e2e/journeys/export-contract/check-your-answers/check-your-answers-summary-list/check-your-answers-summary-list-contracted-awarded-other-method.spec.js b/e2e-tests/insurance/cypress/e2e/journeys/export-contract/check-your-answers/check-your-answers-summary-list/check-your-answers-summary-list-contract-awarded-other-method.spec.js similarity index 100% rename from e2e-tests/insurance/cypress/e2e/journeys/export-contract/check-your-answers/check-your-answers-summary-list/check-your-answers-summary-list-contracted-awarded-other-method.spec.js rename to e2e-tests/insurance/cypress/e2e/journeys/export-contract/check-your-answers/check-your-answers-summary-list/check-your-answers-summary-list-contract-awarded-other-method.spec.js diff --git a/src/ui/server/controllers/insurance/export-contract/map-submitted-data/export-contract/index.test.ts b/src/ui/server/controllers/insurance/export-contract/map-submitted-data/export-contract/index.test.ts index d7dae82ba7..5cc5feec6a 100644 --- a/src/ui/server/controllers/insurance/export-contract/map-submitted-data/export-contract/index.test.ts +++ b/src/ui/server/controllers/insurance/export-contract/map-submitted-data/export-contract/index.test.ts @@ -2,7 +2,7 @@ import mapSubmittedData from '.'; import FIELD_IDS from '../../../../../constants/field-ids/insurance/export-contract'; import getCountryByIsoCode from '../../../../../helpers/get-country-by-iso-code'; import { EXPORT_CONTRACT_AWARD_METHOD } from '../../../../../constants'; -import { mockCountries, mockExportContract, mockOtherAwardMethod } from '../../../../../test-mocks'; +import { mockCountries, mockExportContract } from '../../../../../test-mocks'; import { RequestBody } from '../../../../../../types'; const { @@ -126,7 +126,8 @@ describe('controllers/insurance/export-contract/map-submitted-data/export-contra it(`should return the form body with ${OTHER_AWARD_METHOD} populated`, () => { const mockBody = { ...mockFormBody, - ...mockOtherAwardMethod, + [AWARD_METHOD]: OTHER_DB_ID, + [OTHER_AWARD_METHOD]: mockExportContract.otherAwardMethod, }; const result = mapSubmittedData(mockBody, mockCountries); diff --git a/src/ui/server/test-mocks/index.ts b/src/ui/server/test-mocks/index.ts index e9d2dfd68c..ac21320127 100644 --- a/src/ui/server/test-mocks/index.ts +++ b/src/ui/server/test-mocks/index.ts @@ -27,7 +27,6 @@ import mockApplication, { mockExportContractAgentService, mockExportContractAgentServiceCharge, mockNominatedLossPayee, - mockOtherAwardMethod, referenceNumber, } from './mock-application'; import mockApplications from './mock-applications'; @@ -169,7 +168,6 @@ export { mockLossPayeeFinancialDetailsInternational, mockLossPayeeFinancialDetailsUk, mockNominatedLossPayee, - mockOtherAwardMethod, mockUrlOrigin, mockSession, mockSicCodes, diff --git a/src/ui/server/test-mocks/mock-application.ts b/src/ui/server/test-mocks/mock-application.ts index 163efdcfe9..90bcd84bd0 100644 --- a/src/ui/server/test-mocks/mock-application.ts +++ b/src/ui/server/test-mocks/mock-application.ts @@ -94,6 +94,7 @@ export const mockExportContract = { ...EXPORT_CONTRACT_AWARD_METHOD.COMPETITIVE_BIDDING, id: 'clldfm6pt000noqa6fs6cj5xo', }, + otherAwardMethod: 'Mock other award method', goodsOrServicesDescription: 'Mock description', finalDestinationKnown: false, finalDestinationCountryCode: mockCountries[0].isoCode, @@ -102,11 +103,6 @@ export const mockExportContract = { agent: mockExportContractAgent, }; -export const mockOtherAwardMethod = { - awardMethod: EXPORT_CONTRACT_AWARD_METHOD.OTHER.DB_ID, - otherAwardMethod: 'test', -}; - export const mockOwner = { id: mockAccount.id, };