test(examples): add missing test for tasks example

This commit is contained in:
Dominik Biedebach
2022-05-13 00:56:27 +02:00
committed by Dominik
parent 441b357f91
commit 7b3374efdf

View File

@@ -18,10 +18,15 @@ context('/src/Examples/Tasks/React/', () => {
cy.get('.ProseMirror input[type="checkbox"]').should('have.length', 3) cy.get('.ProseMirror input[type="checkbox"]').should('have.length', 3)
}) })
// TODO: Make this test work properly - right now it's not doing what it
// should do.
it('should check and uncheck tasks on click', () => { it('should check and uncheck tasks on click', () => {
cy.get('.ProseMirror').type('Cook food{enter}Eat food{enter}Clean dishes') cy.get('.ProseMirror').type('Cook food{enter}Eat food{enter}Clean dishes')
cy.get('.ProseMirror').find('input[type="checkbox"]').then(console.log) cy.get('.ProseMirror').find('input[type="checkbox"]').eq(0).click({ force: true })
cy.get('.ProseMirror').find('input[type="checkbox"]:checked').should('have.length', 1)
cy.get('.ProseMirror').find('input[type="checkbox"]').eq(1).click({ force: true })
cy.get('.ProseMirror').find('input[type="checkbox"]:checked').should('have.length', 2)
cy.get('.ProseMirror').find('input[type="checkbox"]').eq(0).click({ force: true })
cy.get('.ProseMirror').find('input[type="checkbox"]:checked').should('have.length', 1)
cy.get('.ProseMirror').find('input[type="checkbox"]').eq(1).click({ force: true })
cy.get('.ProseMirror').find('input[type="checkbox"]:checked').should('have.length', 0)
}) })
}) })