From 7b3374efdff7eb21bacfa723aa9593c8c8bda52e Mon Sep 17 00:00:00 2001 From: Dominik Biedebach Date: Fri, 13 May 2022 00:56:27 +0200 Subject: [PATCH] test(examples): add missing test for tasks example --- demos/src/Examples/Tasks/React/index.spec.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/demos/src/Examples/Tasks/React/index.spec.js b/demos/src/Examples/Tasks/React/index.spec.js index 9a31be20..3b990539 100644 --- a/demos/src/Examples/Tasks/React/index.spec.js +++ b/demos/src/Examples/Tasks/React/index.spec.js @@ -18,10 +18,15 @@ context('/src/Examples/Tasks/React/', () => { 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', () => { 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) }) })