-
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-3787): export contract - agent name with an apostrophe (#2989)
* fix(EMS-3787): export contract - agent name with an apostrophe * fix(EMS-3787): update agent name test mocks
- Loading branch information
Showing
7 changed files
with
100 additions
and
6 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
65 changes: 65 additions & 0 deletions
65
...ith-special-characters/submit-name-fields-with-special-characters-export-contract.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,65 @@ | ||
import { INSURANCE_ROUTES } from '../../../../../constants/routes/insurance'; | ||
import { EXPORT_CONTRACT as FIELD_IDS } from '../../../../../constants/field-ids/insurance/export-contract'; | ||
import { field } from '../../../../../pages/shared'; | ||
|
||
const { | ||
ROOT: INSURANCE_ROOT, | ||
EXPORT_CONTRACT: { AGENT_DETAILS }, | ||
} = INSURANCE_ROUTES; | ||
|
||
const { | ||
AGENT_DETAILS: { NAME }, | ||
} = FIELD_IDS; | ||
|
||
const nameValue = "O'Neill"; | ||
|
||
const baseUrl = Cypress.config('baseUrl'); | ||
|
||
context('Insurance - Name fields - Export contract - Name field should render an apostrophe without character codes after submission', () => { | ||
let referenceNumber; | ||
let agentDetailsUrl; | ||
|
||
before(() => { | ||
cy.completeSignInAndGoToApplication({}).then(({ referenceNumber: refNumber }) => { | ||
referenceNumber = refNumber; | ||
|
||
// go to the page we want to test. | ||
cy.completeAndSubmitExportContractForms({ | ||
isUsingAgent: true, | ||
formToStopAt: 'agent', | ||
}); | ||
|
||
agentDetailsUrl = `${baseUrl}${INSURANCE_ROOT}/${referenceNumber}${AGENT_DETAILS}`; | ||
|
||
cy.assertUrl(agentDetailsUrl); | ||
}); | ||
}); | ||
|
||
beforeEach(() => { | ||
cy.saveSession(); | ||
}); | ||
|
||
after(() => { | ||
cy.deleteApplication(referenceNumber); | ||
}); | ||
|
||
describe(NAME, () => { | ||
describe('when submitting the name field with an apostrophe and going back to the page', () => { | ||
beforeEach(() => { | ||
cy.saveSession(); | ||
|
||
cy.navigateToUrl(agentDetailsUrl); | ||
|
||
cy.completeAndSubmitAgentDetailsForm({ name: nameValue }); | ||
|
||
cy.clickBackLink(); | ||
|
||
cy.assertUrl(agentDetailsUrl); | ||
}); | ||
|
||
it('should render name exactly as they were submitted', () => { | ||
cy.checkValue(field(NAME), nameValue); | ||
}); | ||
}); | ||
}); | ||
}); |
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