don’t check the platform in cypress, use the modifier alias only
This commit is contained in:
@@ -21,16 +21,12 @@ context('/api/extensions/bold', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('the keyboard shortcut should make the selected text bold', () => {
|
it('the keyboard shortcut should make the selected text bold', () => {
|
||||||
const shortcut = Cypress.platform === 'darwin' ? '{meta}b' : '{ctrl}b'
|
cy.get('.ProseMirror').type('{meta}b', {force: true})
|
||||||
|
|
||||||
cy.get('.ProseMirror').type(shortcut, {force: true})
|
|
||||||
cy.get('.ProseMirror').contains('strong', 'Example Text')
|
cy.get('.ProseMirror').contains('strong', 'Example Text')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('the keyboard shortcut should toggle the selected text bold', () => {
|
it('the keyboard shortcut should toggle the selected text bold', () => {
|
||||||
const shortcut = Cypress.platform === 'darwin' ? '{meta}b' : '{ctrl}b'
|
cy.get('.ProseMirror').type('{meta}b', {force: true}).type('{meta}b', {force: true})
|
||||||
|
|
||||||
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')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -19,9 +19,7 @@ context('/api/extensions/history', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('the keyboard shortcut should make the last change undone', () => {
|
it('the keyboard shortcut should make the last change undone', () => {
|
||||||
const shortcut = Cypress.platform === 'darwin' ? '{meta}z' : '{ctrl}z'
|
cy.get('.ProseMirror').type('{meta}z', {force: true})
|
||||||
|
|
||||||
cy.get('.ProseMirror').type(shortcut, {force: true})
|
|
||||||
cy.get('.ProseMirror').should('not.contain', 'Mistake')
|
cy.get('.ProseMirror').should('not.contain', 'Mistake')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@@ -39,13 +37,10 @@ context('/api/extensions/history', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it.skip('the keyboard shortcut should apply the last undone change again', () => {
|
it.skip('the keyboard shortcut should apply the last undone change again', () => {
|
||||||
const undoShortcut = Cypress.platform === 'darwin' ? '{meta}z' : '{ctrl}z'
|
cy.get('.ProseMirror').type('{meta}z', {force: true})
|
||||||
const redoShortcut = Cypress.platform === 'darwin' ? '{meta}{shift}z' : '{ctrl}{shift}z'
|
|
||||||
|
|
||||||
cy.get('.ProseMirror').type(undoShortcut, {force: true})
|
|
||||||
cy.get('.ProseMirror').should('not.contain', 'Mistake')
|
cy.get('.ProseMirror').should('not.contain', 'Mistake')
|
||||||
|
|
||||||
cy.get('.ProseMirror').type(redoShortcut, {force: true})
|
cy.get('.ProseMirror').type('{meta}{shift}z', {force: true})
|
||||||
cy.get('.ProseMirror').should('contain', 'Mistake')
|
cy.get('.ProseMirror').should('contain', 'Mistake')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -21,16 +21,12 @@ context('/api/extensions/italic', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('the keyboard shortcut should make the selected text italic', () => {
|
it('the keyboard shortcut should make the selected text italic', () => {
|
||||||
const shortcut = Cypress.platform === 'darwin' ? '{meta}i' : '{ctrl}i'
|
cy.get('.ProseMirror').type('{meta}i', {force: true})
|
||||||
|
|
||||||
cy.get('.ProseMirror').type(shortcut, {force: true})
|
|
||||||
cy.get('.ProseMirror').contains('em', 'Example Text')
|
cy.get('.ProseMirror').contains('em', 'Example Text')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('the keyboard shortcut should toggle the selected text italic', () => {
|
it('the keyboard shortcut should toggle the selected text italic', () => {
|
||||||
const shortcut = Cypress.platform === 'darwin' ? '{meta}i' : '{ctrl}i'
|
cy.get('.ProseMirror').type('{meta}i', {force: true}).type('{meta}i', {force: true})
|
||||||
|
|
||||||
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