fix tests

This commit is contained in:
Hans Pagel
2020-09-24 18:29:34 +02:00
parent 26d808e1ba
commit e283ec4399

View File

@@ -1,25 +1,31 @@
context('/examples/history', () => { context('/examples/history', () => {
beforeEach(() => { before(() => {
cy.visit('/examples/history') cy.visit('/examples/history')
}) })
beforeEach(() => {
cy.get('.ProseMirror').then(([{ editor }]) => {
editor.clearContent()
})
})
it('should not have a mistake', () => { it('should not have a mistake', () => {
cy.get('.ProseMirror').then(() => { 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', () => { it('should have a mistake', () => {
cy.get('.ProseMirror').then(([{ editor }]) => { cy.get('.ProseMirror').then(([{ editor }]) => {
editor.insertText('Mistake') editor.insertText('Mistake')
cy.get('.ProseMirror h2:first').should('contain', 'Mistake') cy.get('.ProseMirror').should('contain', 'Mistake')
}) })
}) })
it('the mistake should be removed again', () => { it('the mistake should be removed again', () => {
cy.get('.ProseMirror').then(([{ editor }]) => { cy.get('.ProseMirror').then(([{ editor }]) => {
editor.undo() editor.undo()
cy.get('.ProseMirror h2:first').should('not.contain', 'Mistake') cy.get('.ProseMirror').should('not.contain', 'Mistake')
}) })
}) })
}) })