-
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.
fix(EMS-3546): no PDF - Export contract - Agent charges - fixed sum c…
…ommas (#2678) Co-authored-by: Zain Kassam <zkassam@ukexportfinance.gov.uk>
- Loading branch information
Showing
3 changed files
with
102 additions
and
2 deletions.
There are no files selected for viewing
77 changes: 77 additions & 0 deletions
77
.../journeys/export-contract/agent-charges/agent-charges-fixed-sum-amount-with-comma.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,77 @@ | ||
import FIELD_IDS from '../../../../../../constants/field-ids/insurance/export-contract'; | ||
import { INSURANCE_ROUTES } from '../../../../../../constants/routes/insurance'; | ||
|
||
const { | ||
ROOT, | ||
EXPORT_CONTRACT: { AGENT_CHARGES, CHECK_YOUR_ANSWERS }, | ||
} = INSURANCE_ROUTES; | ||
|
||
const { | ||
AGENT_CHARGES: { METHOD, FIXED_SUM }, | ||
} = FIELD_IDS; | ||
|
||
const baseUrl = Cypress.config('baseUrl'); | ||
|
||
context('Insurance - Export contract - Agent charges page - Fixed sum amount with a comma', () => { | ||
let referenceNumber; | ||
let url; | ||
let checkYourAnswersUrl; | ||
|
||
before(() => { | ||
cy.completeSignInAndGoToApplication({}).then(({ referenceNumber: refNumber }) => { | ||
referenceNumber = refNumber; | ||
|
||
// go to the page we want to test. | ||
cy.startInsuranceExportContractSection({}); | ||
cy.completeAndSubmitAboutGoodsOrServicesForm({}); | ||
cy.completeAndSubmitHowYouWillGetPaidForm({}); | ||
cy.completeAndSubmitAgentForm({ isUsingAgent: true }); | ||
cy.completeAndSubmitAgentDetailsForm({}); | ||
cy.completeAndSubmitAgentServiceForm({ agentIsCharging: true }); | ||
|
||
url = `${baseUrl}${ROOT}/${referenceNumber}${AGENT_CHARGES}`; | ||
checkYourAnswersUrl = `${baseUrl}${ROOT}/${referenceNumber}${CHECK_YOUR_ANSWERS}`; | ||
}); | ||
}); | ||
|
||
beforeEach(() => { | ||
cy.saveSession(); | ||
}); | ||
|
||
after(() => { | ||
cy.deleteApplication(referenceNumber); | ||
}); | ||
|
||
describe('form submission', () => { | ||
beforeEach(() => { | ||
cy.navigateToUrl(url); | ||
}); | ||
|
||
describe(`when submitting with ${METHOD} as ${FIXED_SUM} with a comma`, () => { | ||
const fixedSumAmount = '1,000'; | ||
const amount = '1000'; | ||
|
||
it(`should redirect to ${CHECK_YOUR_ANSWERS}`, () => { | ||
cy.completeAndSubmitAgentChargesForm({ fixedSumMethod: true, fixedSumAmount }); | ||
|
||
cy.assertUrl(checkYourAnswersUrl); | ||
}); | ||
|
||
it('should update the `export contract` task status to `completed`', () => { | ||
cy.navigateToAllSectionsUrl(referenceNumber); | ||
|
||
cy.checkTaskExportContractStatusIsComplete(); | ||
}); | ||
|
||
describe('when going back to the page', () => { | ||
beforeEach(() => { | ||
cy.navigateToUrl(url); | ||
}); | ||
|
||
it('should have the submitted value without the comma', () => { | ||
cy.assertAgentChargesFieldValues({ fixedSumMethod: true, expectedFixedSumAmount: amount }); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); |
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