Skip to content

Commit

Permalink
test: check not disabled and checked states before clicking
Browse files Browse the repository at this point in the history
  • Loading branch information
g-saracca committed Dec 4, 2024
1 parent 92ff472 commit 27c1d28
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
<AuthContext.Provider
value={{
Expand Down Expand Up @@ -115,6 +115,8 @@ describe('ValidTokenNotLinkedAccountForm', () => {
)
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()
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 27c1d28

Please sign in to comment.