fix tests again

This commit is contained in:
Philipp Kühn 2020-09-11 22:25:05 +02:00
parent 23ce5bc044
commit cc9425fc07
8 changed files with 22 additions and 22 deletions

View File

@ -28,17 +28,17 @@ context('/api/extensions/blockquote', () => {
})
it('the keyboard shortcut should make the selected line a blockquote', () => {
cy.get('.ProseMirror').trigger('keydown', { shiftKey: true, metaKey: true, keyCode: 57 })
cy.get('.ProseMirror').trigger('keydown', { shiftKey: true, metaKey: true, key: '9' })
cy.get('.ProseMirror').find('blockquote').should('contain', 'Example Text')
})
it('the keyboard shortcut should toggle the blockquote', () => {
cy.get('.ProseMirror blockquote').should('not.exist')
cy.get('.ProseMirror').trigger('keydown', { shiftKey: true, metaKey: true, keyCode: 57 })
cy.get('.ProseMirror').trigger('keydown', { shiftKey: true, metaKey: true, key: '9' })
cy.get('.ProseMirror').find('blockquote').should('contain', 'Example Text')
cy.get('.ProseMirror').type('{selectall}', { force: true })
cy.get('.ProseMirror').trigger('keydown', { shiftKey: true, metaKey: true, keyCode: 57 })
cy.get('.ProseMirror').trigger('keydown', { shiftKey: true, metaKey: true, key: '9' })
cy.get('.ProseMirror blockquote').should('not.exist')
})

View File

@ -25,19 +25,19 @@ context('/api/extensions/bold', () => {
it('the keyboard shortcut should make the selected text bold', () => {
cy.get('.ProseMirror')
.type('{meta}b', { force: true })
.trigger('keydown', { metaKey: true, key: 'b' })
.find('strong')
.should('contain', 'Example Text')
})
it('the keyboard shortcut should toggle the selected text bold', () => {
cy.get('.ProseMirror')
.type('{meta}b', { force: true })
.trigger('keydown', { metaKey: true, key: 'b' })
.find('strong')
.should('contain', 'Example Text')
cy.get('.ProseMirror')
.type('{meta}b', { force: true })
.trigger('keydown', { metaKey: true, key: 'b' })
cy.get('.ProseMirror strong').should('not.exist')
})

View File

@ -26,16 +26,16 @@ context('/api/extensions/code-block', () => {
})
it('the keyboard shortcut should make the selected line a code block', () => {
cy.get('.ProseMirror').trigger('keydown', { shiftKey: true, ctrlKey: true, keyCode: 220 })
cy.get('.ProseMirror').trigger('keydown', { shiftKey: true, ctrlKey: true, key: '\\' })
cy.get('.ProseMirror').find('pre').should('contain', 'Example Text')
})
it('the keyboard shortcut should toggle the code block', () => {
cy.get('.ProseMirror').trigger('keydown', { shiftKey: true, ctrlKey: true, keyCode: 220 })
cy.get('.ProseMirror').trigger('keydown', { shiftKey: true, ctrlKey: true, key: '\\' })
cy.get('.ProseMirror').find('pre').should('contain', 'Example Text')
cy.get('.ProseMirror').type('{selectall}', { force: true })
cy.get('.ProseMirror').trigger('keydown', { shiftKey: true, ctrlKey: true, keyCode: 220 })
cy.get('.ProseMirror').trigger('keydown', { shiftKey: true, ctrlKey: true, key: '\\' })
cy.get('.ProseMirror pre').should('not.exist')
})

View File

@ -24,7 +24,7 @@ context('/api/extensions/hard-break', () => {
it('the alternative keyboard shortcut should add a line break', () => {
cy.get('.ProseMirror br').should('not.exist')
cy.get('.ProseMirror').trigger('keydown', { metaKey: true, keyCode: 13 })
cy.get('.ProseMirror').trigger('keydown', { metaKey: true, key: 'Enter' })
cy.get('.ProseMirror br').should('exist')
})
})

View File

@ -17,7 +17,7 @@ context('/api/extensions/history', () => {
})
it('the keyboard shortcut should make the last change undone', () => {
cy.get('.ProseMirror').trigger('keydown', { metaKey: true, keyCode: 90 })
cy.get('.ProseMirror').trigger('keydown', { metaKey: true, key: 'z' })
cy.get('.ProseMirror').should('not.contain', 'Mistake')
})
@ -30,10 +30,10 @@ context('/api/extensions/history', () => {
})
it.skip('the keyboard shortcut should apply the last undone change again', () => {
cy.get('.ProseMirror').trigger('keydown', { metaKey: true, keyCode: 90 })
cy.get('.ProseMirror').trigger('keydown', { metaKey: true, key: 'z' })
cy.get('.ProseMirror').should('not.contain', 'Mistake')
cy.get('.ProseMirror').trigger('keydown', { metaKey: true, shiftKey: true, keyCode: 90 })
cy.get('.ProseMirror').trigger('keydown', { metaKey: true, shiftKey: true, key: 'z' })
cy.get('.ProseMirror').should('contain', 'Mistake')
})
})

View File

@ -24,13 +24,13 @@ context('/api/extensions/italic', () => {
})
it('the keyboard shortcut should make the selected text italic', () => {
cy.get('.ProseMirror').trigger('keydown', { metaKey: true, keyCode: 73 })
cy.get('.ProseMirror').trigger('keydown', { metaKey: true, key: 'i' })
cy.get('.ProseMirror').find('em').should('contain', 'Example Text')
})
it('the keyboard shortcut should toggle the selected text italic', () => {
cy.get('.ProseMirror').trigger('keydown', { metaKey: true, keyCode: 73 })
cy.get('.ProseMirror').trigger('keydown', { metaKey: true, keyCode: 73 })
cy.get('.ProseMirror').trigger('keydown', { metaKey: true, key: 'i' })
cy.get('.ProseMirror').trigger('keydown', { metaKey: true, key: 'i' })
cy.get('.ProseMirror em').should('not.exist')
})
})

View File

@ -24,13 +24,13 @@ context('/api/extensions/strike', () => {
})
it('the keyboard shortcut should strike the selected text', () => {
cy.get('.ProseMirror').trigger('keydown', { metaKey: true, keyCode: 68 })
cy.get('.ProseMirror').trigger('keydown', { metaKey: true, key: 'd' })
cy.get('.ProseMirror').find('s').should('contain', 'Example Text')
})
it('the keyboard shortcut should toggle the selected text striked', () => {
cy.get('.ProseMirror').trigger('keydown', { metaKey: true, keyCode: 68 })
cy.get('.ProseMirror').trigger('keydown', { metaKey: true, keyCode: 68 })
cy.get('.ProseMirror').trigger('keydown', { metaKey: true, key: 'd' })
cy.get('.ProseMirror').trigger('keydown', { metaKey: true, key: 'd' })
cy.get('.ProseMirror s').should('not.exist')
})

View File

@ -24,13 +24,13 @@ context('/api/extensions/underline', () => {
})
it('the keyboard shortcut should underline the selected text', () => {
cy.get('.ProseMirror').trigger('keydown', { metaKey: true, keyCode: 85 })
cy.get('.ProseMirror').trigger('keydown', { metaKey: true, key: 'u' })
cy.get('.ProseMirror').find('u').should('contain', 'Example Text')
})
it('the keyboard shortcut should toggle the selected text underline', () => {
cy.get('.ProseMirror').trigger('keydown', { metaKey: true, keyCode: 85 })
cy.get('.ProseMirror').trigger('keydown', { metaKey: true, keyCode: 85 })
cy.get('.ProseMirror').trigger('keydown', { metaKey: true, key: 'u' })
cy.get('.ProseMirror').trigger('keydown', { metaKey: true, key: 'u' })
cy.get('.ProseMirror u').should('not.exist')
})
})