test(examples): adds more tests for tables, tasks and commands
This commit is contained in:
committed by
Dominik
parent
b7f95d638d
commit
2a9467ef34
@@ -10,7 +10,6 @@ context('/src/Examples/Tables/React/', () => {
|
||||
})
|
||||
})
|
||||
|
||||
// TODO: Write tests
|
||||
it('adds a table with three columns and three rows', () => {
|
||||
cy.get('.ProseMirror table')
|
||||
.should('exist')
|
||||
|
||||
@@ -10,7 +10,6 @@ context('/src/Examples/Tables/Vue/', () => {
|
||||
})
|
||||
})
|
||||
|
||||
// TODO: Write tests
|
||||
it('adds a table with three columns and three rows', () => {
|
||||
cy.get('.ProseMirror table')
|
||||
.should('exist')
|
||||
|
||||
25
demos/src/Examples/Tasks/React/index.spec.js
Normal file
25
demos/src/Examples/Tasks/React/index.spec.js
Normal file
@@ -0,0 +1,25 @@
|
||||
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)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user