Skip to content

Commit

Permalink
chore(e2e): address todo comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ttbarnes committed Jan 13, 2025
1 parent 95ab7e1 commit 9a2ae96
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const {

const {
ROOT,
POLICY: { BROKER_MANUAL_ADDRESS_ROOT, LOSS_PAYEE_ROOT },
POLICY: { BROKER_DETAILS_ROOT, BROKER_MANUAL_ADDRESS_ROOT, LOSS_PAYEE_ROOT },
} = INSURANCE_ROUTES;

const { BROKER_MANUAL_ADDRESS: FIELD_STRINGS } = FIELDS;
Expand All @@ -34,14 +34,11 @@ context(
referenceNumber = refNumber;

// go to the page we want to test.
cy.completeAndSubmitPolicyForms({ stopSubmittingAfter: 'brokerDetails', usingBroker: true });
cy.completeAndSubmitPolicyForms({ stopSubmittingAfter: 'brokerDetails', usingBroker: true, isBasedInUk: false });

url = `${baseUrl}${ROOT}/${referenceNumber}${BROKER_MANUAL_ADDRESS_ROOT}`;
lossPayeeUrl = `${baseUrl}${ROOT}/${referenceNumber}${LOSS_PAYEE_ROOT}`;

// TODO: EMS-3973 - remove this
cy.navigateToUrl(url);

cy.assertUrl(url);
});
});
Expand All @@ -58,7 +55,7 @@ context(
cy.corePageChecks({
pageTitle: CONTENT_STRINGS.PAGE_TITLE,
currentHref: `${ROOT}/${referenceNumber}${BROKER_MANUAL_ADDRESS_ROOT}`,
backLink: `${ROOT}/${referenceNumber}${BROKER_MANUAL_ADDRESS_ROOT}#`,
backLink: `${ROOT}/${referenceNumber}${BROKER_DETAILS_ROOT}`,
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,10 @@ context('Insurance - Policy - Broker manual address page - Save and back', () =>
referenceNumber = refNumber;

// go to the page we want to test.
cy.completeAndSubmitPolicyForms({ stopSubmittingAfter: 'brokerDetails', usingBroker: true });
cy.completeAndSubmitPolicyForms({ stopSubmittingAfter: 'brokerDetails', usingBroker: true, isBasedInUk: false });

url = `${baseUrl}${ROOT}/${referenceNumber}${BROKER_MANUAL_ADDRESS_ROOT}`;

// TODO: EMS-3973 - remove this
cy.navigateToUrl(url);

cy.assertUrl(url);
});
});
Expand Down Expand Up @@ -76,8 +73,12 @@ context('Insurance - Policy - Broker manual address page - Save and back', () =>
});

it('should have the originally submitted answer selected when going back to the page after submission', () => {
// TODO: EMS-3973 - remove this, use cy.clickSubmitButtonMultipleTimes instead.
cy.navigateToUrl(url);
cy.navigateToAllSectionsUrl(referenceNumber);

cy.startInsurancePolicySection({});

// go through 8 policy forms.
cy.clickSubmitButtonMultipleTimes({ count: 8 });

cy.checkTextareaValue({
fieldId: FIELD_ID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,10 @@ context('Insurance - Policy - Broker manual address page - validation', () => {
referenceNumber = refNumber;

// go to the page we want to test.
cy.completeAndSubmitPolicyForms({ stopSubmittingAfter: 'brokerDetails', usingBroker: true });
cy.completeAndSubmitPolicyForms({ stopSubmittingAfter: 'brokerDetails', usingBroker: true, isBasedInUk: false });

url = `${baseUrl}${ROOT}/${referenceNumber}${BROKER_MANUAL_ADDRESS_ROOT}`;

// TODO: EMS-3973 - remove this
cy.navigateToUrl(url);

cy.assertUrl(url);
});
});
Expand Down

0 comments on commit 9a2ae96

Please sign in to comment.