From bd6d8691cb0421fb979dffc2e13f99be6d8c7742 Mon Sep 17 00:00:00 2001 From: Zain Kassam Date: Wed, 31 Jul 2024 10:01:01 +0100 Subject: [PATCH] feat(EMS-3676): added test for radio option rendering --- .../change-your-answers-member-of-a-group.spec.js | 8 +++++++- .../change-your-answers-party-to-consortium.spec.js | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/e2e-tests/insurance/cypress/e2e/journeys/eligibility/change-your-answers/change-your-answers-member-of-a-group.spec.js b/e2e-tests/insurance/cypress/e2e/journeys/eligibility/change-your-answers/change-your-answers-member-of-a-group.spec.js index 3366b6a6cd..316457b06e 100644 --- a/e2e-tests/insurance/cypress/e2e/journeys/eligibility/change-your-answers/change-your-answers-member-of-a-group.spec.js +++ b/e2e-tests/insurance/cypress/e2e/journeys/eligibility/change-your-answers/change-your-answers-member-of-a-group.spec.js @@ -30,13 +30,19 @@ context( const fieldId = IS_MEMBER_OF_A_GROUP; describe('when clicking the `change` link', () => { - it(`should redirect to ${MEMBER_OF_A_GROUP_CHANGE}`, () => { + beforeEach(() => { cy.navigateToUrl(url); summaryList.field(fieldId).changeLink().click(); + }); + it(`should redirect to ${MEMBER_OF_A_GROUP_CHANGE}`, () => { cy.assertChangeAnswersPageUrl({ route: MEMBER_OF_A_GROUP_CHANGE, fieldId, isInsuranceEligibility: true }); }); + + it(`should have the "no" radio selected`, () => { + cy.assertNoRadioOptionIsChecked(); + }); }); describe('form submission without changing the answer', () => { diff --git a/e2e-tests/insurance/cypress/e2e/journeys/eligibility/change-your-answers/change-your-answers-party-to-consortium.spec.js b/e2e-tests/insurance/cypress/e2e/journeys/eligibility/change-your-answers/change-your-answers-party-to-consortium.spec.js index f0a7ff89ee..2d33696a27 100644 --- a/e2e-tests/insurance/cypress/e2e/journeys/eligibility/change-your-answers/change-your-answers-party-to-consortium.spec.js +++ b/e2e-tests/insurance/cypress/e2e/journeys/eligibility/change-your-answers/change-your-answers-party-to-consortium.spec.js @@ -30,13 +30,19 @@ context( const fieldId = IS_PARTY_TO_CONSORTIUM; describe('when clicking the `change` link', () => { - it(`should redirect to ${PARTY_TO_CONSORTIUM_CHANGE}`, () => { + beforeEach(() => { cy.navigateToUrl(url); summaryList.field(fieldId).changeLink().click(); + }); + it(`should redirect to ${PARTY_TO_CONSORTIUM_CHANGE}`, () => { cy.assertChangeAnswersPageUrl({ route: PARTY_TO_CONSORTIUM_CHANGE, fieldId, isInsuranceEligibility: true }); }); + + it(`should have the "no" radio selected`, () => { + cy.assertNoRadioOptionIsChecked(); + }); }); describe('form submission without changing the answer', () => {