Skip to content

Commit

Permalink
fix(EMS-4100): fix/update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ttbarnes committed Jan 14, 2025
1 parent f84df69 commit 3063da1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 18 deletions.
2 changes: 0 additions & 2 deletions e2e-tests/content-strings/pages/quote.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ const GET_A_QUOTE_BY_EMAIL = {
REASON: {
TYPE_OF_BUYER: 'We cannot give you a quote online because your buyer is a government or public sector body.',
TYPE_OF_BUYER_DESCRIPTION: 'We can still give you a quote but may need extra information from you to assess the risks around your buyer first.',
BUYER_COUNTRY: 'We cannot give you a quote online because of the country where your buyer is based.',
BUYER_COUNTRY_DESCRIPTION: "We can still give you a quote but may need extra information from you to assess the risks around your buyer's country first.",
},
ACTION: [
[
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
import { autoCompleteField } from '../../../../../pages/shared';
import { getAQuoteByEmailPage } from '../../../../../pages/quote';
import { PAGES } from '../../../../../content-strings';
import { ROUTES, FIELD_IDS } from '../../../../../constants';
import { COUNTRY_QUOTE_SUPPORT } from '../../../../../fixtures/countries';
import { ROUTES } from '../../../../../constants';

const CONTENT_STRINGS = PAGES.QUOTE.GET_A_QUOTE_BY_EMAIL;

const FIELD_ID = FIELD_IDS.ELIGIBILITY.BUYER_COUNTRY;

const COUNTRY_NAME_QUOTE_BY_EMAIL_ONLY = COUNTRY_QUOTE_SUPPORT.NO_ONLINE_SUPPORT_1.NAME;

const baseUrl = Cypress.config('baseUrl');

context('Get a quote via email exit page', () => {
beforeEach(() => {
cy.navigateToRootUrl();

cy.keyboardInput(autoCompleteField(FIELD_ID).input(), COUNTRY_NAME_QUOTE_BY_EMAIL_ONLY);

const results = autoCompleteField(FIELD_ID).results();
results.first().click();
cy.completeAndSubmitBuyerCountryForm({});

cy.clickYesRadioInput();
cy.clickSubmitButton();

const expectedUrl = `${baseUrl}${ROUTES.QUOTE.GET_A_QUOTE_BY_EMAIL}`;
Expand All @@ -32,7 +24,7 @@ context('Get a quote via email exit page', () => {
cy.corePageChecks({
pageTitle: CONTENT_STRINGS.PAGE_TITLE,
currentHref: ROUTES.QUOTE.GET_A_QUOTE_BY_EMAIL,
backLink: ROUTES.QUOTE.BUYER_COUNTRY,
backLink: ROUTES.QUOTE.TYPE_OF_BUYER,
hasAForm: false,
assertAuthenticatedHeader: false,
isInsurancePage: false,
Expand All @@ -44,9 +36,9 @@ context('Get a quote via email exit page', () => {
});

it('renders a reason and description ', () => {
cy.checkText(getAQuoteByEmailPage.reason(), CONTENT_STRINGS.REASON.BUYER_COUNTRY);
cy.checkText(getAQuoteByEmailPage.reason(), CONTENT_STRINGS.REASON.TYPE_OF_BUYER);

cy.checkText(getAQuoteByEmailPage.description(), CONTENT_STRINGS.REASON.BUYER_COUNTRY_DESCRIPTION);
cy.checkText(getAQuoteByEmailPage.description(), CONTENT_STRINGS.REASON.TYPE_OF_BUYER_DESCRIPTION);
});

it('renders `action` content', () => {
Expand Down
2 changes: 0 additions & 2 deletions src/ui/server/content-strings/pages/quote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ const GET_A_QUOTE_BY_EMAIL = {
REASON: {
TYPE_OF_BUYER: 'We cannot give you a quote online because your buyer is a government or public sector body.',
TYPE_OF_BUYER_DESCRIPTION: 'We can still give you a quote but may need extra information from you to assess the risks around your buyer first.',
BUYER_COUNTRY: 'We cannot give you a quote online because of the country where your buyer is based.',
BUYER_COUNTRY_DESCRIPTION: "We can still give you a quote but may need extra information from you to assess the risks around your buyer's country first.",
},
ACTION: [
[
Expand Down

0 comments on commit 3063da1

Please sign in to comment.