add shortcuts to bold and italic tests
This commit is contained in:
@@ -10,14 +10,24 @@ context('/api/extensions/bold', () => {
|
||||
})
|
||||
|
||||
describe('bold', () => {
|
||||
it('should make the selected text bold', () => {
|
||||
it('the button should make the selected text bold', () => {
|
||||
cy.get('.demo__preview button:first').click({ force: true })
|
||||
cy.get('.ProseMirror').contains('strong', 'Example Text')
|
||||
})
|
||||
|
||||
it('should toggle the selected text bold', () => {
|
||||
it('the button should toggle the selected text bold', () => {
|
||||
cy.get('.demo__preview button:first').dblclick({ force: true })
|
||||
cy.get('.ProseMirror strong').should('not.exist')
|
||||
})
|
||||
|
||||
it('the keyboard shortcut should make the selected text bold', () => {
|
||||
cy.get('.ProseMirror').type('{meta}b', {force: true})
|
||||
cy.get('.ProseMirror').contains('strong', 'Example Text')
|
||||
})
|
||||
|
||||
it('the button should toggle the selected text bold', () => {
|
||||
cy.get('.ProseMirror').type('{meta}b', {force: true}).type('{meta}b', {force: true})
|
||||
cy.get('.ProseMirror strong').should('not.exist')
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -19,5 +19,15 @@ context('/api/extensions/italic', () => {
|
||||
cy.get('.demo__preview button:first').dblclick({ force: true })
|
||||
cy.get('.ProseMirror em').should('not.exist')
|
||||
})
|
||||
|
||||
it('the keyboard shortcut should make the selected text italic', () => {
|
||||
cy.get('.ProseMirror').type('{meta}i', {force: true})
|
||||
cy.get('.ProseMirror').contains('em', 'Example Text')
|
||||
})
|
||||
|
||||
it('the button should toggle the selected text italic', () => {
|
||||
cy.get('.ProseMirror').type('{meta}i', {force: true}).type('{meta}i', {force: true})
|
||||
cy.get('.ProseMirror em').should('not.exist')
|
||||
})
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user