Skip to content

Commit f562f23

Browse files
authored
fix(EMS-3945): policy - total contract value - credit limit hint (#3197)
* fix(EMS-3945): policy - total contract value - credit limit hint * fix(EMS-3945): e2e hint selector improvements * fix(EMS-3945): e2e hint selector improvements * fix(EMS-3945): fix/update e2e tests
1 parent 9ca5efd commit f562f23

File tree

27 files changed

+71
-97
lines changed

27 files changed

+71
-97
lines changed

e2e-tests/commands/insurance/account/assert-password-label-hint-and-input.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import field from '../../../partials/insurance/passwordField';
33
const assertPasswordLabelHintAndInput = (fieldStrings) => {
44
cy.checkText(field.label(), fieldStrings.LABEL);
55

6-
cy.checkText(field.hint.intro(), fieldStrings.HINT.INTRO);
6+
cy.checkText(field.hintIntro(), fieldStrings.HINT.INTRO);
77
cy.checkText(field.hint.listItem1(), fieldStrings.HINT.RULES[0]);
88
cy.checkText(field.hint.listItem2(), fieldStrings.HINT.RULES[1]);
99
cy.checkText(field.hint.listItem3(), fieldStrings.HINT.RULES[2]);

e2e-tests/commands/quote/forms.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { field } from '../../pages/shared';
2-
import { policyTypePage, tellUsAboutYourPolicyPage } from '../../pages/quote';
2+
import { policyTypePage } from '../../pages/quote';
33
import { FIELD_IDS } from '../../constants';
44
import { GBP_CURRENCY_CODE } from '../../fixtures/currencies';
55

@@ -57,6 +57,6 @@ export const completeAndSubmitTellUsAboutYourMultiPolicyForm = () => {
5757
field(CURRENCY).input().select(GBP_CURRENCY_CODE);
5858
cy.keyboardInput(field(MAX_AMOUNT_OWED).input(), '150000');
5959
field(PERCENTAGE_OF_COVER).input().select('90');
60-
tellUsAboutYourPolicyPage[CREDIT_PERIOD].input().select('1');
60+
field(CREDIT_PERIOD).input().select('1');
6161
cy.clickSubmitButton();
6262
};

e2e-tests/content-strings/fields/insurance/policy/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ export const POLICY_FIELDS = {
104104
},
105105
[CONTRACT_POLICY.SINGLE.REQUESTED_CREDIT_LIMIT]: {
106106
LABEL: 'What credit limit do you require?',
107-
HINT: 'For example, your total contract maybe £250,000 but the amount you want to insure is £100,000.',
107+
HINT: {
108+
INTRO: 'For example, your total contract maybe £250,000 but the amount you want to insure is £100,000.',
109+
OUTRO: 'Enter a whole number. Do not enter decimals.',
110+
},
108111
SUMMARY: {
109112
TITLE: 'Credit limit',
110113
FORM_TITLE: POLICY_FORM_TITLES.CONTRACT_POLICY,

e2e-tests/insurance/cypress/e2e/journeys/declarations/anti-bribery/code-of-conduct/anti-bribery-code-of-conduct.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { headingCaption, yesRadio, noRadio } from '../../../../../../../pages/shared';
1+
import { field, headingCaption, yesRadio, noRadio } from '../../../../../../../pages/shared';
22
import { codeOfConductPage } from '../../../../../../../pages/insurance/declarations';
33
import { PAGES, LINKS, ERROR_MESSAGES } from '../../../../../../../content-strings';
44
import { FIELD_IDS, FIELD_VALUES } from '../../../../../../../constants';
@@ -61,9 +61,9 @@ context(
6161
});
6262

6363
it('renders a hint', () => {
64-
cy.checkText(codeOfConductPage.hint.intro(), CONTENT_STRINGS.HINT.INTRO);
64+
cy.checkText(field(FIELD_ID).hintIntro(), CONTENT_STRINGS.HINT.INTRO);
6565

66-
cy.checkLink(codeOfConductPage.hint.link(), LINKS.EXTERNAL.BRIBERY_ACT_2010_GUIDANCE, CONTENT_STRINGS.HINT.LINK.TEXT);
66+
cy.checkLink(field(FIELD_ID).hintLink(), LINKS.EXTERNAL.BRIBERY_ACT_2010_GUIDANCE, CONTENT_STRINGS.HINT.LINK.TEXT);
6767
});
6868

6969
it('renders `yes` radio button', () => {

e2e-tests/insurance/cypress/e2e/journeys/export-contract/about-goods-or-services/about-goods-or-services.spec.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { headingCaption, yesRadio, noRadio, autoCompleteField } from '../../../../../../pages/shared';
1+
import { autoCompleteField, field as fieldSelector, headingCaption, yesRadio, noRadio } from '../../../../../../pages/shared';
22
import { aboutGoodsOrServicesPage } from '../../../../../../pages/insurance/export-contract';
33
import { PAGES } from '../../../../../../content-strings';
44
import { EXPORT_CONTRACT_FIELDS as FIELDS } from '../../../../../../content-strings/fields/insurance/export-contract';
@@ -70,22 +70,22 @@ context(
7070

7171
it(`renders ${DESCRIPTION} label, hint and input`, () => {
7272
const fieldId = DESCRIPTION;
73-
const field = aboutGoodsOrServicesPage[fieldId];
73+
const { HINT, LABEL, MAXIMUM } = FIELDS.ABOUT_GOODS_OR_SERVICES[fieldId];
7474

75-
const fieldStrings = FIELDS.ABOUT_GOODS_OR_SERVICES[fieldId];
75+
cy.checkText(fieldSelector(fieldId).hintIntro(), HINT.INTRO);
7676

77-
cy.checkText(field.hint.intro(), fieldStrings.HINT.INTRO);
77+
const { hint } = aboutGoodsOrServicesPage[fieldId];
7878

79-
cy.checkText(field.hint.list.item1(), fieldStrings.HINT.LIST[0]);
80-
cy.checkText(field.hint.list.item2(), fieldStrings.HINT.LIST[1]);
81-
cy.checkText(field.hint.list.item3(), fieldStrings.HINT.LIST[2]);
79+
cy.checkText(hint.list.item1(), HINT.LIST[0]);
80+
cy.checkText(hint.list.item2(), HINT.LIST[1]);
81+
cy.checkText(hint.list.item3(), HINT.LIST[2]);
8282

83-
cy.checkText(field.hint.outro(), fieldStrings.HINT.OUTRO);
83+
cy.checkText(fieldSelector(fieldId).hintOutro(), HINT.OUTRO);
8484

8585
cy.assertTextareaRendering({
8686
fieldId,
87-
expectedLabel: fieldStrings.LABEL,
88-
maximumCharacters: fieldStrings.MAXIMUM,
87+
expectedLabel: LABEL,
88+
maximumCharacters: MAXIMUM,
8989
});
9090
});
9191

e2e-tests/insurance/cypress/e2e/journeys/export-contract/how-much-the-agent-is-charging/save-and-back.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ context('Insurance - Export contract - How much the agent is charging - Save and
4747
beforeEach(() => {
4848
cy.navigateToUrl(url);
4949

50-
cy.completeHowMuchTheAgentIsChargingForm({ fixedSumAmount: '' });
51-
5250
cy.clickSaveAndBackButton();
5351
});
5452

@@ -67,6 +65,8 @@ context('Insurance - Export contract - How much the agent is charging - Save and
6765
beforeEach(() => {
6866
cy.navigateToUrl(url);
6967

68+
cy.completeHowMuchTheAgentIsChargingForm({ fixedSumAmount });
69+
7070
cy.clickSaveAndBackButton();
7171
});
7272

e2e-tests/insurance/cypress/e2e/journeys/export-contract/how-will-you-get-paid/how-will-you-get-paid.spec.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { headingCaption } from '../../../../../../pages/shared';
1+
import { field as fieldSelector, headingCaption } from '../../../../../../pages/shared';
22
import { howWillYouGetPaidPage } from '../../../../../../pages/insurance/export-contract';
33
import { EXPECTED_MULTI_LINE_STRING, MAXIMUM_CHARACTERS } from '../../../../../../constants';
44
import { ERROR_MESSAGES, PAGES } from '../../../../../../content-strings';
@@ -73,13 +73,15 @@ context(
7373
it(`renders ${FIELD_ID} hint and textarea`, () => {
7474
const { HINT } = FIELD_STRINGS.HOW_WILL_YOU_GET_PAID[FIELD_ID];
7575

76-
cy.checkText(field.hint.intro(), HINT.INTRO);
76+
cy.checkText(fieldSelector(FIELD_ID).hintIntro(), HINT.INTRO);
7777

78-
cy.checkText(field.hint.list.item1(), HINT.LIST[0]);
79-
cy.checkText(field.hint.list.item2(), HINT.LIST[1]);
80-
cy.checkText(field.hint.list.item3(), HINT.LIST[2]);
78+
const { hint } = field;
8179

82-
cy.checkText(field.hint.outro(), HINT.OUTRO);
80+
cy.checkText(hint.list.item1(), HINT.LIST[0]);
81+
cy.checkText(hint.list.item2(), HINT.LIST[1]);
82+
cy.checkText(hint.list.item3(), HINT.LIST[2]);
83+
84+
cy.checkText(fieldSelector(FIELD_ID).hintOutro(), HINT.OUTRO);
8385

8486
cy.assertTextareaRendering({
8587
fieldId: FIELD_ID,

e2e-tests/insurance/cypress/e2e/journeys/policy/loss-payee/loss-payee.spec.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import partials from '../../../../../../partials';
22
import { field as fieldSelector, noRadio, noRadioInput, yesRadio } from '../../../../../../pages/shared';
3-
import { lossPayeePage } from '../../../../../../pages/insurance/policy';
43
import { ERROR_MESSAGES, PAGES } from '../../../../../../content-strings';
54
import { FIELD_VALUES } from '../../../../../../constants';
65
import { INSURANCE_ROUTES } from '../../../../../../constants/routes/insurance';
@@ -79,8 +78,8 @@ context(
7978
},
8079
} = FIELD_STRINGS;
8180

82-
cy.checkText(lossPayeePage.radioHint(FIELD_ID).intro(), INTRO);
83-
cy.checkText(lossPayeePage.radioHint(FIELD_ID).outro(), OUTRO);
81+
cy.checkText(fieldSelector(FIELD_ID).hintIntro(), INTRO);
82+
cy.checkText(fieldSelector(FIELD_ID).hintOutro(), OUTRO);
8483
});
8584

8685
it('renders a `no` radio button', () => {

e2e-tests/insurance/cypress/e2e/journeys/policy/single-contract-policy/total-contract-value/single-contract-policy-total-contract-value.spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ context(
8080
const fieldId = REQUESTED_CREDIT_LIMIT;
8181
const field = fieldSelector(fieldId);
8282

83-
cy.checkText(field.hint(), FIELDS.CONTRACT_POLICY.SINGLE[fieldId].HINT);
83+
cy.checkText(field.hintIntro(), FIELDS.CONTRACT_POLICY.SINGLE[fieldId].HINT.INTRO);
84+
cy.checkText(field.hintOutro(), FIELDS.CONTRACT_POLICY.SINGLE[fieldId].HINT.OUTRO);
8485

8586
cy.assertPrefix({ fieldId, value: SYMBOLS.GBP });
8687

e2e-tests/insurance/cypress/e2e/journeys/your-buyer/connection-with-the-buyer/connection-with-the-buyer-page.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ context(
6363

6464
describe(CONNECTION_WITH_BUYER, () => {
6565
it('renders a hint', () => {
66-
const field = connectionWithBuyerPage[CONNECTION_WITH_BUYER];
66+
const { hint } = connectionWithBuyerPage[CONNECTION_WITH_BUYER];
6767

6868
const { HINT } = FIELD_STRINGS[CONNECTION_WITH_BUYER];
6969

70-
cy.checkText(field.hint.intro(), HINT.INTRO);
70+
cy.checkText(fieldSelector(CONNECTION_WITH_BUYER).hintIntro(), HINT.INTRO);
7171

72-
cy.checkText(field.hint.list.item1(), HINT.LIST[0]);
73-
cy.checkText(field.hint.list.item2(), HINT.LIST[1]);
72+
cy.checkText(hint.list.item1(), HINT.LIST[0]);
73+
cy.checkText(hint.list.item2(), HINT.LIST[1]);
7474
});
7575

7676
it('renders `yes` and `no` radio buttons in the correct order', () => {

e2e-tests/pages/insurance/declarations/code-of-conduct.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ const {
77
} = FIELD_IDS;
88

99
const codeOfConductPage = {
10-
hint: {
11-
intro: () => cy.get(`[data-cy="${HAS_ANTI_BRIBERY_CODE_OF_CONDUCT}-hint-intro"]`),
12-
link: () => cy.get(`[data-cy="${HAS_ANTI_BRIBERY_CODE_OF_CONDUCT}-hint-link"]`),
13-
},
1410
revealText: () => cy.get(`[data-cy="${HAS_ANTI_BRIBERY_CODE_OF_CONDUCT}-reveal-text"]`),
1511
};
1612

e2e-tests/pages/insurance/export-contract/aboutGoodsOrServices.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,11 @@ const aboutGoodsOrServices = {
1111
[DESCRIPTION]: {
1212
...field(DESCRIPTION),
1313
hint: {
14-
intro: () => cy.get(`[data-cy="${DESCRIPTION}-hint-intro"]`),
1514
list: {
1615
item1: () => cy.get(`[data-cy="${DESCRIPTION}-hint-list-item-1"]`),
1716
item2: () => cy.get(`[data-cy="${DESCRIPTION}-hint-list-item-2"]`),
1817
item3: () => cy.get(`[data-cy="${DESCRIPTION}-hint-list-item-3"]`),
1918
},
20-
outro: () => cy.get(`[data-cy="${DESCRIPTION}-hint-outro"]`),
2119
},
2220
},
2321
};

e2e-tests/pages/insurance/export-contract/howWillYouGetPaid.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,11 @@ const howWillYouGetPaid = {
1414
...field,
1515
input: field.textarea,
1616
hint: {
17-
intro: () => cy.get(`[data-cy="${PAYMENT_TERMS_DESCRIPTION}-hint-intro"]`),
1817
list: {
1918
item1: () => cy.get(`[data-cy="${PAYMENT_TERMS_DESCRIPTION}-hint-list-item-1"]`),
2019
item2: () => cy.get(`[data-cy="${PAYMENT_TERMS_DESCRIPTION}-hint-list-item-2"]`),
2120
item3: () => cy.get(`[data-cy="${PAYMENT_TERMS_DESCRIPTION}-hint-list-item-3"]`),
2221
},
23-
outro: () => cy.get(`[data-cy="${PAYMENT_TERMS_DESCRIPTION}-hint-outro"]`),
2422
},
2523
},
2624
};
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import brokerPage from './broker';
22
import brokerConfirmAddressPage from './brokerConfirmAddress';
3-
import lossPayeePage from './lossPayee';
43
import multipleContractPolicyExportValuePage from './multipleContractPolicyExportValue';
54
import typeOfPolicyPage from './typeOfPolicy';
65

7-
export { brokerPage, brokerConfirmAddressPage, lossPayeePage, multipleContractPolicyExportValuePage, typeOfPolicyPage };
6+
export { brokerPage, brokerConfirmAddressPage, multipleContractPolicyExportValuePage, typeOfPolicyPage };

e2e-tests/pages/insurance/policy/lossPayee.js

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
1-
import { field } from '../shared';
2-
import { FIELD_IDS } from '../../constants';
3-
4-
const {
5-
ELIGIBILITY: { CREDIT_PERIOD },
6-
} = FIELD_IDS;
7-
81
const tellUsAboutYourPolicyPage = {
92
description: () => cy.get('[data-cy="description"]'),
10-
[CREDIT_PERIOD]: {
11-
...field(CREDIT_PERIOD),
12-
hintLink: () => cy.get(`[data-cy="${CREDIT_PERIOD}-hint-link"]`),
13-
},
143
};
154

165
export default tellUsAboutYourPolicyPage;

e2e-tests/partials/insurance/passwordField.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ const { PASSWORD } = ACCOUNT;
66
const passwordField = {
77
...field(PASSWORD),
88
hint: {
9-
intro: () => cy.get(`[data-cy="${PASSWORD}-hint-intro"]`),
109
listItem1: () => cy.get(`[data-cy="${PASSWORD}-hint-list-item-1"]`),
1110
listItem2: () => cy.get(`[data-cy="${PASSWORD}-hint-list-item-2"]`),
1211
listItem3: () => cy.get(`[data-cy="${PASSWORD}-hint-list-item-3"]`),

e2e-tests/quote/cypress/e2e/journeys/quote/change-your-answers/change-policy-type-multiple-times-via-back-button.spec.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { policyTypePage, tellUsAboutYourPolicyPage } from '../../../../../../pages/quote';
1+
import { field as fieldSelector } from '../../../../../../pages/shared';
2+
import { policyTypePage } from '../../../../../../pages/quote';
23
import { FIELD_IDS, ROUTES } from '../../../../../../constants';
34

45
const {
@@ -55,9 +56,7 @@ context(
5556
policyTypePage[POLICY_TYPE].multiple.label().click();
5657
cy.clickSubmitButton();
5758

58-
const field = tellUsAboutYourPolicyPage[CREDIT_PERIOD];
59-
60-
field.input().should('exist');
59+
fieldSelector(CREDIT_PERIOD).input().should('exist');
6160
});
6261

6362
context('change for a second time - policy type from multiple to single', () => {
@@ -79,7 +78,7 @@ context(
7978
});
8079

8180
it('does NOT render credit period field in the `tell us about your policy` page', () => {
82-
const field = tellUsAboutYourPolicyPage[CREDIT_PERIOD];
81+
const field = fieldSelector(CREDIT_PERIOD);
8382

8483
field.label().should('not.exist');
8584
field.hint().should('not.exist');
@@ -117,9 +116,7 @@ context(
117116
});
118117

119118
it('renders credit period field in the `tell us about your policy` page', () => {
120-
const field = tellUsAboutYourPolicyPage[CREDIT_PERIOD];
121-
122-
field.input().should('exist');
119+
fieldSelector(CREDIT_PERIOD).input().should('exist');
123120
});
124121
});
125122
},

e2e-tests/quote/cypress/e2e/journeys/quote/change-your-answers/change-your-answers-policy-fields-multi-policy-credit-period.spec.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { backLink, summaryList } from '../../../../../../pages/shared';
2-
import { tellUsAboutYourPolicyPage } from '../../../../../../pages/quote';
1+
import { backLink, field, summaryList } from '../../../../../../pages/shared';
32
import { FIELD_IDS, ROUTES } from '../../../../../../constants';
43
import { LINKS } from '../../../../../../content-strings';
54

@@ -44,15 +43,15 @@ context('Change your answers (policy credit period field) - as an exporter, I wa
4443
});
4544

4645
it('has originally submitted answer', () => {
47-
const firstOption = tellUsAboutYourPolicyPage[CREDIT_PERIOD].inputOption().eq(0);
46+
const firstOption = field(CREDIT_PERIOD).inputOption().eq(0);
4847
firstOption.should('have.attr', 'selected', 'selected');
4948

50-
const secondOption = tellUsAboutYourPolicyPage[CREDIT_PERIOD].inputOption().eq(1);
49+
const secondOption = field(CREDIT_PERIOD).inputOption().eq(1);
5150
secondOption.should('not.have.attr', 'selected');
5251
});
5352

5453
it(`redirects to ${CHECK_YOUR_ANSWERS} when submitting a new answer`, () => {
55-
tellUsAboutYourPolicyPage[CREDIT_PERIOD].input().select('2');
54+
field(CREDIT_PERIOD).input().select('2');
5655

5756
cy.clickSubmitButton();
5857

e2e-tests/quote/cypress/e2e/journeys/quote/tell-us-about-your-policy/tell-us-about-your-multi-policy-validation.spec.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { field as fieldSelector } from '../../../../../../pages/shared';
22
import partials from '../../../../../../partials';
3-
import { tellUsAboutYourPolicyPage } from '../../../../../../pages/quote';
43
import { ERROR_MESSAGES } from '../../../../../../content-strings';
54
import { FIELD_IDS, ROUTES } from '../../../../../../constants';
65
import { GBP_CURRENCY_CODE } from '../../../../../../fixtures/currencies';
@@ -57,7 +56,7 @@ context('Tell us about the multiple policy you need - form validation', () => {
5756
// credit period
5857
cy.checkText(partials.errorSummaryListItems().eq(3), ERROR_MESSAGES.ELIGIBILITY[CREDIT_PERIOD].IS_EMPTY);
5958

60-
cy.checkText(tellUsAboutYourPolicyPage[CREDIT_PERIOD].errorMessage(), `Error: ${ERROR_MESSAGES.ELIGIBILITY[CREDIT_PERIOD].IS_EMPTY}`);
59+
cy.checkText(fieldSelector(CREDIT_PERIOD).errorMessage(), `Error: ${ERROR_MESSAGES.ELIGIBILITY[CREDIT_PERIOD].IS_EMPTY}`);
6160
});
6261

6362
it('should focus on inputs when clicking summary error message', () => {
@@ -75,7 +74,7 @@ context('Tell us about the multiple policy you need - form validation', () => {
7574

7675
// credit period
7776
partials.errorSummaryListItemLinks().eq(3).click();
78-
tellUsAboutYourPolicyPage[CREDIT_PERIOD].input().should('have.focus');
77+
fieldSelector(CREDIT_PERIOD).input().should('have.focus');
7978
});
8079
});
8180

@@ -126,7 +125,7 @@ context('Tell us about the multiple policy you need - form validation', () => {
126125

127126
cy.checkText(partials.errorSummaryListItems().eq(3), ERROR_MESSAGES.ELIGIBILITY[CREDIT_PERIOD].IS_EMPTY);
128127

129-
cy.checkText(tellUsAboutYourPolicyPage[CREDIT_PERIOD].errorMessage(), `Error: ${ERROR_MESSAGES.ELIGIBILITY[CREDIT_PERIOD].IS_EMPTY}`);
128+
cy.checkText(fieldSelector(CREDIT_PERIOD).errorMessage(), `Error: ${ERROR_MESSAGES.ELIGIBILITY[CREDIT_PERIOD].IS_EMPTY}`);
130129
});
131130
});
132131

e2e-tests/quote/cypress/e2e/journeys/quote/tell-us-about-your-policy/tell-us-about-your-multi-policy.spec.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { field as fieldSelector } from '../../../../../../pages/shared';
2-
import { tellUsAboutYourPolicyPage } from '../../../../../../pages/quote';
32
import { LINKS, FIELDS, PAGES } from '../../../../../../content-strings';
43
import { ROUTES, FIELD_IDS } from '../../../../../../constants';
54
import { EUR, GBP, JPY, USD } from '../../../../../../fixtures/currencies';
@@ -131,7 +130,7 @@ context('Tell us about your multiple policy page - as an exporter, I want to pro
131130
it('should render `credit period` label, hint and input with correct options', () => {
132131
const fieldId = CREDIT_PERIOD;
133132

134-
const field = tellUsAboutYourPolicyPage[fieldId];
133+
const field = fieldSelector(fieldId);
135134

136135
cy.checkText(field.label(), FIELDS[fieldId].LABEL);
137136

@@ -163,7 +162,7 @@ context('Tell us about your multiple policy page - as an exporter, I want to pro
163162
cy.keyboardInput(fieldSelector(MAX_AMOUNT_OWED).input(), '100');
164163
fieldSelector(CURRENCY).input().select(GBP.isoCode);
165164
fieldSelector(PERCENTAGE_OF_COVER).input().select('90');
166-
tellUsAboutYourPolicyPage[CREDIT_PERIOD].input().select('1');
165+
fieldSelector(CREDIT_PERIOD).input().select('1');
167166

168167
cy.clickSubmitButton();
169168

0 commit comments

Comments
 (0)