-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(EMS-4011-4022): policy - change your answers - broker address (#…
…3482) * feat(EMS-4011-4120): policy - change your answers - broker address * feat(EMS-4011-4120): policy - change your answers - broker address * chore(EMS-4011-4120): update e2e tests * feat(EMS-4011-4120): policy - change your answers - broker based in uk * chore(e2e): align test descriptions * feat(EMS-4011-4120): update e2e tests * feat(EMS-4011-4120): update 'different address ur' to handle change routes * fix(EMS-4011): broker summary list address field mapping * feat(EMS-4011-4120): fix typos * chore(mocks): update ui mock broker data * chore(docs): remove unnecessary comments * feat(EMS-4011-4120): address todo comments * feat(EMS-4011-4120): update e2e test * feat(EMS-4011-4120): create brokerDetailsDataChangeFlags helper function * feat(EMS-4011-4120): address todo comment * feat(EMS-4011-4120): refactor/extract broker details redirection logic * chore(EMS-4011): fix linting issue * feat(EMS-4011-4120): minor code edits
- Loading branch information
Showing
72 changed files
with
1,213 additions
and
384 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...e/policy-conditions/submit-an-application-multiple-policy-type-broker-based-in-uk.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...licy-conditions/submit-an-application-multiple-policy-type-broker-not-based-in-uk.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../submit-an-application-multiple-policy-type-with-broker-based-in-uk-building-name.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ubmit-an-application-multiple-policy-type-with-broker-based-in-uk-building-number.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ype/policy-conditions/submit-an-application-single-policy-type-broker-based-in-uk.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...policy-conditions/submit-an-application-single-policy-type-broker-not-based-in-uk.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ns/submit-an-application-single-policy-type-with-broker-based-in-uk-building-name.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../submit-an-application-single-policy-type-with-broker-based-in-uk-building-number.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
...-answers/broker/change-your-answers-change-address-based-in-uk-to-not-based-in-uk.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import { summaryList } from '../../../../../../../pages/shared'; | ||
import { POLICY as POLICY_FIELD_IDS } from '../../../../../../../constants/field-ids/insurance/policy'; | ||
import { INSURANCE_ROUTES } from '../../../../../../../constants/routes/insurance'; | ||
import checkSummaryList from '../../../../../../../commands/insurance/check-policy-summary-list'; | ||
|
||
const { | ||
USING_BROKER, | ||
BROKER_DETAILS: { NAME, EMAIL }, | ||
BROKER_ADDRESSES: { SELECT_THE_ADDRESS }, | ||
BROKER_MANUAL_ADDRESS: { FULL_ADDRESS }, | ||
} = POLICY_FIELD_IDS; | ||
|
||
const { | ||
ROOT, | ||
POLICY: { BROKER_CONFIRM_ADDRESS_CHANGE, CHECK_YOUR_ANSWERS }, | ||
} = INSURANCE_ROUTES; | ||
|
||
const baseUrl = Cypress.config('baseUrl'); | ||
|
||
context( | ||
'Insurance - Policy - Change your answers - Broker address - Based in UK to Not based in UK - As an exporter, I want to change my answers to the broker section', | ||
() => { | ||
let referenceNumber; | ||
let checkYourAnswersUrl; | ||
|
||
before(() => { | ||
cy.completeSignInAndGoToApplication({}).then(({ referenceNumber: refNumber }) => { | ||
referenceNumber = refNumber; | ||
|
||
cy.completePolicySection({ usingBroker: true, brokerIsBasedInUk: true }); | ||
|
||
checkYourAnswersUrl = `${baseUrl}${ROOT}/${referenceNumber}${CHECK_YOUR_ANSWERS}`; | ||
}); | ||
}); | ||
|
||
beforeEach(() => { | ||
cy.saveSession(); | ||
}); | ||
|
||
after(() => { | ||
cy.deleteApplication(referenceNumber); | ||
}); | ||
|
||
describe('when clicking the `change` link', () => { | ||
it(`should redirect to ${BROKER_CONFIRM_ADDRESS_CHANGE}`, () => { | ||
cy.navigateToUrl(checkYourAnswersUrl); | ||
|
||
summaryList.field(SELECT_THE_ADDRESS).changeLink().click(); | ||
|
||
cy.assertChangeAnswersPageUrl({ referenceNumber, route: BROKER_CONFIRM_ADDRESS_CHANGE, fieldId: SELECT_THE_ADDRESS }); | ||
}); | ||
}); | ||
|
||
describe('after changing the answer from no to yes and completing (now required) non UK broker address field', () => { | ||
beforeEach(() => { | ||
cy.navigateToUrl(checkYourAnswersUrl); | ||
}); | ||
|
||
it(`should redirect to ${CHECK_YOUR_ANSWERS}`, () => { | ||
summaryList.field(NAME).changeLink().click(); | ||
|
||
cy.completeAndSubmitBrokerDetailsForm({ isBasedInUk: false }); | ||
cy.completeAndSubmitBrokerManualAddressForm({}); | ||
|
||
cy.assertChangeAnswersPageUrl({ referenceNumber, route: CHECK_YOUR_ANSWERS, fieldId: NAME }); | ||
}); | ||
|
||
it(`should render the new ${FULL_ADDRESS} answer and related fields`, () => { | ||
checkSummaryList[USING_BROKER]({ usingBroker: true }); | ||
checkSummaryList.BROKER[NAME](); | ||
checkSummaryList.BROKER[EMAIL](); | ||
|
||
checkSummaryList.BROKER[FULL_ADDRESS]({ shouldRender: true }); | ||
}); | ||
|
||
it(`should NOT render ${SELECT_THE_ADDRESS} field`, () => { | ||
checkSummaryList.BROKER[SELECT_THE_ADDRESS]({ shouldRender: false }); | ||
}); | ||
}); | ||
}, | ||
); |
Oops, something went wrong.