really fix tests

This commit is contained in:
Hans Pagel
2020-09-11 15:57:33 +02:00
parent 2e67d64d68
commit 1b414ab33c
20 changed files with 501 additions and 514 deletions

View File

@@ -1,30 +1,30 @@
context('/api/extensions/hard-break', () => {
beforeEach(() => {
before(() => {
cy.visit('/api/extensions/hard-break')
})
beforeEach(() => {
cy.get('.ProseMirror').window().then(window => {
const { editor } = window
editor.setContent('<p>Example Text</p>')
})
})
describe('hard-break', () => {
it('the button should add a line break', () => {
cy.get('.ProseMirror br').should('not.exist')
cy.get('.demo__preview button:first').click({ force: true })
cy.get('.ProseMirror br').should('exist')
})
it('the button should add a line break', () => {
cy.get('.ProseMirror br').should('not.exist')
cy.get('.demo__preview button:first').click({ force: true })
cy.get('.ProseMirror br').should('exist')
})
it('the default keyboard shortcut should add a line break', () => {
cy.get('.ProseMirror br').should('not.exist')
cy.get('.ProseMirror').type('{shift}{enter}', {force: true})
cy.get('.ProseMirror br').should('exist')
})
it('the default keyboard shortcut should add a line break', () => {
cy.get('.ProseMirror br').should('not.exist')
cy.get('.ProseMirror').type('{shift}{enter}', { force: true })
cy.get('.ProseMirror br').should('exist')
})
it('the alternative keyboard shortcut should add a line break', () => {
cy.get('.ProseMirror br').should('not.exist')
cy.get('.ProseMirror').type('{meta}{enter}', {force: true})
cy.get('.ProseMirror br').should('exist')
})
it('the alternative keyboard shortcut should add a line break', () => {
cy.get('.ProseMirror br').should('not.exist')
cy.get('.ProseMirror').type('{meta}{enter}', { force: true })
cy.get('.ProseMirror br').should('exist')
})
})