diff --git a/docs/src/demos/Extensions/HardBreak/index.spec.js b/docs/src/demos/Extensions/HardBreak/index.spec.js index 73c6f908..6e6aba7a 100644 --- a/docs/src/demos/Extensions/HardBreak/index.spec.js +++ b/docs/src/demos/Extensions/HardBreak/index.spec.js @@ -1,5 +1,30 @@ context('/api/extensions/hard-break', () => { beforeEach(() => { cy.visit('/api/extensions/hard-break') + + cy.get('.ProseMirror').window().then(window => { + const { editor } = window + editor.setContent('
Example Text
') + }) + }) + + describe('hard-break', () => { + it('the button should add a line break', () => { + cy.get('.ProseMirror br').should('not.exist') + cy.get('.demo__preview button:first').click({ force: true }) + cy.get('.ProseMirror br').should('exist') + }) + + it('the default keyboard shortcut should add a line break', () => { + cy.get('.ProseMirror br').should('not.exist') + cy.get('.ProseMirror').type('{shift}{enter}', {force: true}) + cy.get('.ProseMirror br').should('exist') + }) + + it('the alternative keyboard shortcut should add a line break', () => { + cy.get('.ProseMirror br').should('not.exist') + cy.get('.ProseMirror').type('{meta}{enter}', {force: true}) + cy.get('.ProseMirror br').should('exist') + }) }) }) \ No newline at end of file diff --git a/docs/src/demos/Extensions/HardBreak/index.vue b/docs/src/demos/Extensions/HardBreak/index.vue index 2ee240ad..92d76959 100644 --- a/docs/src/demos/Extensions/HardBreak/index.vue +++ b/docs/src/demos/Extensions/HardBreak/index.vue @@ -1,5 +1,9 @@