diff --git a/docs/src/demos/Extensions/History/index.spec.js b/docs/src/demos/Extensions/History/index.spec.js index 6f8e940b0..e8f35871e 100644 --- a/docs/src/demos/Extensions/History/index.spec.js +++ b/docs/src/demos/Extensions/History/index.spec.js @@ -80,4 +80,32 @@ context('/demos/Extensions/History', () => { cy.get('.ProseMirror') .should('contain', 'Mistake') }) + + it('should disable undo button when there are no more changes to undo', () => { + cy.get('.ProseMirror') + .should('contain', 'Mistake') + + cy.get('button:first') + .should('not.have.attr', 'disabled') + + cy.get('button:first') + .click() + + cy.get('button:first') + .should('have.attr', 'disabled') + }) + + it('should disable redo button when there are no more changes to redo', () => { + cy.get('.ProseMirror') + .should('contain', 'Mistake') + + cy.get('button:nth-child(2)') + .should('have.attr', 'disabled') + + cy.get('button:first') + .click() + + cy.get('button:nth-child(2)') + .should('not.have.attr', 'disabled') + }) }) diff --git a/docs/src/demos/Extensions/History/index.vue b/docs/src/demos/Extensions/History/index.vue index a29e7cabb..43a705208 100644 --- a/docs/src/demos/Extensions/History/index.vue +++ b/docs/src/demos/Extensions/History/index.vue @@ -1,9 +1,15 @@