don’t check the platform in cypress, use the modifier alias only

This commit is contained in:
Hans Pagel
2020-09-10 11:21:51 +02:00
parent 18e7124c68
commit 8ce9a440a7
3 changed files with 7 additions and 20 deletions

View File

@@ -21,16 +21,12 @@ context('/api/extensions/italic', () => {
})
it('the keyboard shortcut should make the selected text italic', () => {
const shortcut = Cypress.platform === 'darwin' ? '{meta}i' : '{ctrl}i'
cy.get('.ProseMirror').type(shortcut, {force: true})
cy.get('.ProseMirror').type('{meta}i', {force: true})
cy.get('.ProseMirror').contains('em', 'Example Text')
})
it('the keyboard shortcut should toggle the selected text italic', () => {
const shortcut = Cypress.platform === 'darwin' ? '{meta}i' : '{ctrl}i'
cy.get('.ProseMirror').type(shortcut, {force: true}).type(shortcut, {force: true})
cy.get('.ProseMirror').type('{meta}i', {force: true}).type('{meta}i', {force: true})
cy.get('.ProseMirror em').should('not.exist')
})
})