-
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-2433): no PDF - Eligibility - No short term cover redirect (#…
…2621) * feat(EMS-2433): added redirect if noShortTermCover * feat(EMS-2433): code and test fixes * feat(EMS-2433): removed apply-offline, added correct mapping for cis countries and tests * feat(EMS-2433): fixed failing test * feat(EMS-2433): code and test fixes * feat(EMS-2433): lint fix * feat(EMS-2433): fixed failing tests * feat(EMS-2433): removed cannot apply offline page --------- Co-authored-by: Zain Kassam <zkassam@ukexportfinance.gov.uk>
- Loading branch information
Showing
41 changed files
with
564 additions
and
701 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
23 changes: 23 additions & 0 deletions
23
...ts/commands/insurance/eligibility/enter-country-and-assert-exit-page-url-buyer-country.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,23 @@ | ||
import { FIELD_IDS } from '../../../constants'; | ||
|
||
const FIELD_ID = FIELD_IDS.ELIGIBILITY.BUYER_COUNTRY; | ||
|
||
const baseUrl = Cypress.config('baseUrl'); | ||
|
||
/** | ||
* enterCountryAndAssertExitPageUrlBuyerCountry | ||
* can assert if url is correct after entering country that leads to exit page | ||
* @param {String} country to input | ||
* @param {String} url to check for exit page | ||
*/ | ||
const enterCountryAndAssertExitPageUrlBuyerCountry = (country, url) => { | ||
cy.autocompleteKeyboardInput(FIELD_ID, country); | ||
|
||
cy.clickSubmitButton(); | ||
|
||
const expectedUrl = `${baseUrl}${url}`; | ||
|
||
cy.assertUrl(expectedUrl); | ||
}; | ||
|
||
export default enterCountryAndAssertExitPageUrlBuyerCountry; |
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
79 changes: 0 additions & 79 deletions
79
e2e-tests/insurance/cypress/e2e/journeys/apply-offline-page.spec.js
This file was deleted.
Oops, something went wrong.
71 changes: 0 additions & 71 deletions
71
...s/e2e/journeys/eligibility/buyer-country/buyer-country-country-only-apply-offline.spec.js
This file was deleted.
Oops, something went wrong.
40 changes: 40 additions & 0 deletions
40
.../cypress/e2e/journeys/eligibility/buyer-country/buyer-country-no-short-term-cover.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,40 @@ | ||
import { INSURANCE_ROUTES } from '../../../../../../constants/routes/insurance'; | ||
import { COUNTRY_APPLICATION_SUPPORT } from '../../../../../../fixtures/countries'; | ||
|
||
const { | ||
START, | ||
ELIGIBILITY: { CONTRACT_TOO_SHORT }, | ||
} = INSURANCE_ROUTES; | ||
|
||
const COUNTRY_NAME_1 = COUNTRY_APPLICATION_SUPPORT.NO_SHORT_TERM_COVER_1.NAME; | ||
const COUNTRY_NAME_2 = COUNTRY_APPLICATION_SUPPORT.NO_SHORT_TERM_COVER_2.NAME; | ||
|
||
context( | ||
'Insurance - Buyer country page - As an exporter, I want to check if UKEF offer credit insurance policy for where my buyer is based - submit no short term country cover', | ||
() => { | ||
beforeEach(() => { | ||
cy.saveSession(); | ||
|
||
cy.navigateToUrl(START); | ||
|
||
cy.completeStartForm(); | ||
cy.completeCheckIfEligibleForm(); | ||
cy.completeExporterLocationForm(); | ||
cy.completeCompaniesHouseNumberForm(); | ||
cy.completeAndSubmitCompaniesHouseSearchForm({}); | ||
cy.completeEligibilityCompanyDetailsForm(); | ||
}); | ||
|
||
describe(COUNTRY_NAME_1, () => { | ||
it(`redirects to ${CONTRACT_TOO_SHORT} exit page`, () => { | ||
cy.enterCountryAndAssertExitPageUrlBuyerCountry(COUNTRY_NAME_1, CONTRACT_TOO_SHORT); | ||
}); | ||
}); | ||
|
||
describe(COUNTRY_NAME_2, () => { | ||
it(`redirects to ${CONTRACT_TOO_SHORT} exit page`, () => { | ||
cy.enterCountryAndAssertExitPageUrlBuyerCountry(COUNTRY_NAME_2, CONTRACT_TOO_SHORT); | ||
}); | ||
}); | ||
}, | ||
); |
53 changes: 53 additions & 0 deletions
53
...ypress/e2e/journeys/eligibility/buyer-country/buyer-country-unsupported-countries.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,53 @@ | ||
import { INSURANCE_ROUTES } from '../../../../../../constants/routes/insurance'; | ||
import { COUNTRY_APPLICATION_SUPPORT } from '../../../../../../fixtures/countries'; | ||
|
||
const { | ||
START, | ||
ELIGIBILITY: { CANNOT_APPLY }, | ||
} = INSURANCE_ROUTES; | ||
|
||
const COUNTRY_NAME_1 = COUNTRY_APPLICATION_SUPPORT.UNSUPPORTED_1.NAME; | ||
const COUNTRY_NAME_2 = COUNTRY_APPLICATION_SUPPORT.UNSUPPORTED_2.NAME; | ||
const COUNTRY_NAME_3 = COUNTRY_APPLICATION_SUPPORT.UNSUPPORTED_3.NAME; | ||
const COUNTRY_NAME_4 = COUNTRY_APPLICATION_SUPPORT.UNSUPPORTED_4.NAME; | ||
|
||
const contextString = 'As an exporter I want to enter the country where my buyer is based So that I can ascertain if I can obtain UKEF Credit Insurance for the country where my buyer is based'; | ||
|
||
context(`Insurance - Buyer country page - ${contextString} - Unsupported countries`, () => { | ||
beforeEach(() => { | ||
cy.saveSession(); | ||
|
||
cy.navigateToUrl(START); | ||
|
||
cy.completeStartForm(); | ||
cy.completeCheckIfEligibleForm(); | ||
cy.completeExporterLocationForm(); | ||
cy.completeCompaniesHouseNumberForm(); | ||
cy.completeAndSubmitCompaniesHouseSearchForm({}); | ||
cy.completeEligibilityCompanyDetailsForm(); | ||
}); | ||
|
||
describe(COUNTRY_NAME_1, () => { | ||
it(`redirects to ${CANNOT_APPLY} exit page`, () => { | ||
cy.enterCountryAndAssertExitPageUrlBuyerCountry(COUNTRY_NAME_1, CANNOT_APPLY); | ||
}); | ||
}); | ||
|
||
describe(COUNTRY_NAME_2, () => { | ||
it(`redirects to ${CANNOT_APPLY} exit page`, () => { | ||
cy.enterCountryAndAssertExitPageUrlBuyerCountry(COUNTRY_NAME_2, CANNOT_APPLY); | ||
}); | ||
}); | ||
|
||
describe(COUNTRY_NAME_3, () => { | ||
it(`redirects to ${CANNOT_APPLY} exit page`, () => { | ||
cy.enterCountryAndAssertExitPageUrlBuyerCountry(COUNTRY_NAME_3, CANNOT_APPLY); | ||
}); | ||
}); | ||
|
||
describe(COUNTRY_NAME_4, () => { | ||
it(`redirects to ${CANNOT_APPLY} exit page`, () => { | ||
cy.enterCountryAndAssertExitPageUrlBuyerCountry(COUNTRY_NAME_4, CANNOT_APPLY); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.