add keyboard shortcut tests to the history extension

This commit is contained in:
Hans Pagel
2020-09-04 14:42:30 +02:00
parent 93428ba850
commit 970138d036
3 changed files with 22 additions and 41 deletions

View File

@@ -10,12 +10,12 @@ context('/api/extensions/italic', () => {
})
describe('italic', () => {
it('should make the selected text italic', () => {
it('the button should make the selected text italic', () => {
cy.get('.demo__preview button:first').click({ force: true })
cy.get('.ProseMirror').contains('em', 'Example Text')
})
it('should toggle the selected text italic', () => {
it('the button should toggle the selected text italic', () => {
cy.get('.demo__preview button:first').dblclick({ force: true })
cy.get('.ProseMirror em').should('not.exist')
})
@@ -27,7 +27,7 @@ context('/api/extensions/italic', () => {
cy.get('.ProseMirror').contains('em', 'Example Text')
})
it('the button 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(shortcut, {force: true}).type(shortcut, {force: true})