diff --git a/docs/src/demos/Examples/History/index.spec.js b/docs/src/demos/Examples/History/index.spec.js index cafd08c9..8e5d02ac 100644 --- a/docs/src/demos/Examples/History/index.spec.js +++ b/docs/src/demos/Examples/History/index.spec.js @@ -1,25 +1,31 @@ context('/examples/history', () => { - beforeEach(() => { + before(() => { cy.visit('/examples/history') }) + beforeEach(() => { + cy.get('.ProseMirror').then(([{ editor }]) => { + editor.clearContent() + }) + }) + it('should not have a mistake', () => { cy.get('.ProseMirror').then(() => { - cy.get('.ProseMirror h2:first').should('not.contain', 'Mistake') + cy.get('.ProseMirror').should('not.contain', 'Mistake') }) }) it('should have a mistake', () => { cy.get('.ProseMirror').then(([{ editor }]) => { editor.insertText('Mistake') - cy.get('.ProseMirror h2:first').should('contain', 'Mistake') + cy.get('.ProseMirror').should('contain', 'Mistake') }) }) it('the mistake should be removed again', () => { cy.get('.ProseMirror').then(([{ editor }]) => { editor.undo() - cy.get('.ProseMirror h2:first').should('not.contain', 'Mistake') + cy.get('.ProseMirror').should('not.contain', 'Mistake') }) }) })