1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-01-17 21:49:20 +01:00
Anish Aggarwal e65eeb2939
added cypress tests (#4420)
* created editable-voids cypress test

* created markdown-preview cypress test

* created images cypress test

* created huge-document cypress test

* added hovering-toolbar, and forced-layout cypress tests

* added embeds cypress test

No changeset as it's adding tests for the examples.
2021-08-07 08:28:22 -07:00

36 lines
930 B
TypeScript

describe('Check-lists example', () => {
beforeEach(() => {
cy.visit('examples/check-lists')
})
it('checks the bullet when clicked', () => {
const slateNodeElement = 'div[data-slate-node="element"]'
cy.get(slateNodeElement).should('have.length', 6)
cy.get(slateNodeElement)
.eq(3)
.should('contain', 'Criss-cross!')
.find('span')
.eq(1)
.should('have.css', 'text-decoration-line', 'line-through')
// Unchecking the checkboxes should un-cross the corresponding text.
cy.get(slateNodeElement)
.eq(3)
.should('contain', 'Criss-cross!')
.find('span')
.eq(0)
.find('input')
.uncheck()
.get(slateNodeElement)
.eq(3)
.should('contain', 'Criss-cross!')
.find('span')
.eq(1)
.should('have.css', 'text-decoration-line', 'none')
cy.get('p[data-slate-node="element"]').should('have.length', 2)
})
})