Files
tiptap/docs/src/demos/Extensions/HardBreak/index.spec.js
2020-09-10 12:11:42 +02:00

30 lines
1020 B
JavaScript

context('/api/extensions/hard-break', () => {
beforeEach(() => {
cy.visit('/api/extensions/hard-break')
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 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')
})
})
})