replace all contains

This commit is contained in:
Philipp Kühn
2020-09-11 21:56:08 +02:00
parent 88d4d2216b
commit 66841f2fe2
12 changed files with 81 additions and 73 deletions

View File

@@ -3,16 +3,15 @@ context('/api/extensions/history', () => {
cy.visit('/api/extensions/history')
})
beforeEach(done => {
beforeEach(() => {
cy.get('.ProseMirror').then(([{ editor }]) => {
editor.focus()
editor.setContent('<p>Mistake</p>')
done()
})
})
it('should make the last change undone', () => {
cy.get('.ProseMirror').contains('Mistake')
cy.get('.ProseMirror').should('contain', 'Mistake')
cy.get('.demo__preview button:first').click({ force: true })
cy.get('.ProseMirror').should('not.contain', 'Mistake')
})
@@ -23,11 +22,11 @@ context('/api/extensions/history', () => {
})
it('should apply the last undone change again', () => {
cy.get('.ProseMirror').contains('Mistake')
cy.get('.ProseMirror').should('contain', 'Mistake')
cy.get('.demo__preview button:first').click({ force: true })
cy.get('.ProseMirror').should('not.contain', 'Mistake')
cy.get('.demo__preview button:nth-child(2)').click({ force: true })
cy.get('.ProseMirror').contains('Mistake')
cy.get('.ProseMirror').should('contain', 'Mistake')
})
it.skip('the keyboard shortcut should apply the last undone change again', () => {
@@ -35,6 +34,6 @@ context('/api/extensions/history', () => {
cy.get('.ProseMirror').should('not.contain', 'Mistake')
cy.get('.ProseMirror').type('{meta}{shift}z', { force: true })
cy.get('.ProseMirror').contains('Mistake')
cy.get('.ProseMirror').should('contain', 'Mistake')
})
})