diff --git a/docs/src/demos/Guide/Content/ReadOnly/index.spec.js b/docs/src/demos/Guide/Content/ReadOnly/index.spec.js index 17cc73cf..60522041 100644 --- a/docs/src/demos/Guide/Content/ReadOnly/index.spec.js +++ b/docs/src/demos/Guide/Content/ReadOnly/index.spec.js @@ -1,12 +1,18 @@ context('/demos/Guide/Content/ReadOnly', () => { - beforeEach(() => { + before(() => { cy.visit('/demos/Guide/Content/ReadOnly') }) + beforeEach(() => { + cy.get('.ProseMirror').then(([{ editor }]) => { + editor.commands.clearContent() + }) + }) + it('should be read-only', () => { cy.get('.ProseMirror').then(([{ editor }]) => { editor.setEditable(false) - editor.commands.insertContent('Edited: ') + cy.get('.ProseMirror').type('Edited: ') cy.get('.ProseMirror p:first').should('not.contain', 'Edited: ') }) @@ -15,7 +21,7 @@ context('/demos/Guide/Content/ReadOnly', () => { it('should be editable', () => { cy.get('.ProseMirror').then(([{ editor }]) => { editor.setEditable(true) - editor.commands.insertContent('Edited: ') + cy.get('.ProseMirror').type('Edited: ') cy.get('.ProseMirror p:first').should('contain', 'Edited: ') })