From 27c1d280a31d2ff06c3d8228e8a97b6284d3f580 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Germ=C3=A1n=20Saracca?= Date: Wed, 4 Dec 2024 17:46:15 -0300 Subject: [PATCH] test: check not disabled and checked states before clicking --- .../ValidTokenNotLinkedAccountForm.spec.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/component/sections/sign-up/valid-token-not-linked-account-form/ValidTokenNotLinkedAccountForm.spec.tsx b/tests/component/sections/sign-up/valid-token-not-linked-account-form/ValidTokenNotLinkedAccountForm.spec.tsx index 0670893c8..7cd07715a 100644 --- a/tests/component/sections/sign-up/valid-token-not-linked-account-form/ValidTokenNotLinkedAccountForm.spec.tsx +++ b/tests/component/sections/sign-up/valid-token-not-linked-account-form/ValidTokenNotLinkedAccountForm.spec.tsx @@ -86,7 +86,7 @@ describe('ValidTokenNotLinkedAccountForm', () => { }) describe('submit form with correct data', () => { - it.only('submits the form with the correct data when tokenData has preferred username, given name, family name and email ', () => { + it('submits the form with the correct data when tokenData has preferred username, given name, family name and email ', () => { cy.customMount( { ) cy.findByTestId('termsAcceptedCheckbox').check({ force: true }) + cy.findByTestId('termsAcceptedCheckbox').should('be.checked') + cy.findByRole('button', { name: 'Create Account' }).should('not.be.disabled') cy.findByRole('button', { name: 'Create Account' }).click() @@ -157,17 +159,23 @@ describe('ValidTokenNotLinkedAccountForm', () => { cy.findByTestId('termsAcceptedCheckbox').check({ force: true }) + cy.findByTestId('termsAcceptedCheckbox').should('be.checked') + cy.findByRole('button', { name: 'Create Account' }).should('not.be.disabled') // Uncheck and then check again to test validation error from terms not accepted cy.findByTestId('termsAcceptedCheckbox').uncheck({ force: true }) + cy.findByTestId('termsAcceptedCheckbox').should('not.be.checked') + cy.findByText( 'Please check the box to indicate your acceptance of the General Terms of Use.' ).should('exist') cy.findByTestId('termsAcceptedCheckbox').check({ force: true }) + cy.findByTestId('termsAcceptedCheckbox').should('be.checked') + cy.findByRole('button', { name: 'Create Account' }).should('not.be.disabled') cy.findByRole('button', { name: 'Create Account' }).click()