Files
tiptap/docs/src/demos/Examples/History/index.spec.js
2020-09-08 17:39:24 +02:00

36 lines
969 B
JavaScript

context('/examples/history', () => {
beforeEach(() => {
cy.visit('/examples/history')
})
describe('undo', () => {
it('should not have a mistake', () => {
cy.get('.ProseMirror').window().then(window => {
const { editor } = window
const html = editor.html()
cy.get('.ProseMirror h2:first').should('not.contain', 'Mistake')
})
})
it('should have a mistake', () => {
cy.get('.ProseMirror').window().then(window => {
const { editor } = window
const html = editor.html()
editor.insertText('Mistake')
cy.get('.ProseMirror h2:first').should('contain', 'Mistake')
})
})
it('the mistake should be removed again', () => {
cy.get('.ProseMirror').window().then(window => {
const { editor } = window
const html = editor.html()
editor.undo()
cy.get('.ProseMirror h2:first').should('not.contain', 'Mistake')
})
})
})
})