diff --git a/docs/src/demos/Extensions/Bold/index.spec.js b/docs/src/demos/Extensions/Bold/index.spec.js index 8c280f85..e72ca3f4 100644 --- a/docs/src/demos/Extensions/Bold/index.spec.js +++ b/docs/src/demos/Extensions/Bold/index.spec.js @@ -21,12 +21,16 @@ context('/api/extensions/bold', () => { }) it('the keyboard shortcut should make the selected text bold', () => { - cy.get('.ProseMirror').type('{meta}b', {force: true}) + const shortcut = Cypress.platform === 'darwin' ? '{meta}b' : '{ctrl}b' + + cy.get('.ProseMirror').type(shortcut, {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}) + const shortcut = Cypress.platform === 'darwin' ? '{meta}b' : '{ctrl}b' + + cy.get('.ProseMirror').type(shortcut, {force: true}).type(shortcut, {force: true}) cy.get('.ProseMirror strong').should('not.exist') }) }) diff --git a/docs/src/demos/Extensions/Italic/index.spec.js b/docs/src/demos/Extensions/Italic/index.spec.js index 0e7bd42e..60b7206e 100644 --- a/docs/src/demos/Extensions/Italic/index.spec.js +++ b/docs/src/demos/Extensions/Italic/index.spec.js @@ -21,12 +21,16 @@ context('/api/extensions/italic', () => { }) it('the keyboard shortcut should make the selected text italic', () => { - cy.get('.ProseMirror').type('{meta}i', {force: true}) + const shortcut = Cypress.platform === 'darwin' ? '{meta}i' : '{ctrl}i' + + cy.get('.ProseMirror').type(shortcut, {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}) + const shortcut = Cypress.platform === 'darwin' ? '{meta}i' : '{ctrl}i' + + cy.get('.ProseMirror').type(shortcut, {force: true}).type(shortcut, {force: true}) cy.get('.ProseMirror em').should('not.exist') }) })