Files
tiptap/demos/src/Examples/Tasks/React/index.spec.js
2022-05-16 12:49:12 +02:00

26 lines
780 B
JavaScript

context('/src/Examples/Tasks/React/', () => {
before(() => {
cy.visit('/src/Examples/Tasks/React/')
})
beforeEach(() => {
cy.get('.ProseMirror').then(([{ editor }]) => {
editor.commands.clearContent()
})
})
it('should always use task items', () => {
cy.get('.ProseMirror input[type="checkbox"]').should('have.length', 1)
})
it('should create new tasks', () => {
cy.get('.ProseMirror').type('Cook food{enter}Eat food{enter}Clean dishes')
cy.get('.ProseMirror input[type="checkbox"]').should('have.length', 3)
})
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)
})
})