From e283ec4399e4b4b0868e4c5abbe656f8f7802b5c Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Thu, 24 Sep 2020 18:29:34 +0200 Subject: [PATCH] fix tests --- docs/src/demos/Examples/History/index.spec.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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') }) }) })