diff --git a/docs/src/demos/Extensions/Bold/index.spec.js b/docs/src/demos/Extensions/Bold/index.spec.js index 8437be92..8c280f85 100644 --- a/docs/src/demos/Extensions/Bold/index.spec.js +++ b/docs/src/demos/Extensions/Bold/index.spec.js @@ -10,14 +10,24 @@ context('/api/extensions/bold', () => { }) describe('bold', () => { - it('should make the selected text bold', () => { + it('the button should make the selected text bold', () => { cy.get('.demo__preview button:first').click({ force: true }) cy.get('.ProseMirror').contains('strong', 'Example Text') }) - it('should toggle the selected text bold', () => { + it('the button should toggle the selected text bold', () => { cy.get('.demo__preview button:first').dblclick({ force: true }) cy.get('.ProseMirror strong').should('not.exist') }) + + it('the keyboard shortcut should make the selected text bold', () => { + cy.get('.ProseMirror').type('{meta}b', {force: true}) + cy.get('.ProseMirror').contains('strong', 'Example Text') + }) + + it('the button should toggle the selected text bold', () => { + cy.get('.ProseMirror').type('{meta}b', {force: true}).type('{meta}b', {force: true}) + cy.get('.ProseMirror strong').should('not.exist') + }) }) }) \ No newline at end of file diff --git a/docs/src/demos/Extensions/Italic/index.spec.js b/docs/src/demos/Extensions/Italic/index.spec.js index 6b2df56f..0e7bd42e 100644 --- a/docs/src/demos/Extensions/Italic/index.spec.js +++ b/docs/src/demos/Extensions/Italic/index.spec.js @@ -19,5 +19,15 @@ context('/api/extensions/italic', () => { cy.get('.demo__preview button:first').dblclick({ force: true }) cy.get('.ProseMirror em').should('not.exist') }) + + it('the keyboard shortcut should make the selected text italic', () => { + cy.get('.ProseMirror').type('{meta}i', {force: true}) + cy.get('.ProseMirror').contains('em', 'Example Text') + }) + + it('the button should toggle the selected text italic', () => { + cy.get('.ProseMirror').type('{meta}i', {force: true}).type('{meta}i', {force: true}) + cy.get('.ProseMirror em').should('not.exist') + }) }) }) \ No newline at end of file