refactor platform related shortcuts
This commit is contained in:
@@ -21,12 +21,16 @@ context('/api/extensions/bold', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('the keyboard shortcut should make the selected text 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')
|
cy.get('.ProseMirror').contains('strong', 'Example Text')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('the button should toggle the selected text bold', () => {
|
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')
|
cy.get('.ProseMirror strong').should('not.exist')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -21,12 +21,16 @@ context('/api/extensions/italic', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('the keyboard shortcut should make the selected text 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')
|
cy.get('.ProseMirror').contains('em', 'Example Text')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('the button should toggle the selected text italic', () => {
|
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')
|
cy.get('.ProseMirror em').should('not.exist')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user