mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-01-17 21:49:20 +01:00
e65eeb2939
* 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.
36 lines
930 B
TypeScript
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)
|
|
})
|
|
})
|