# Conflicts: # docs/src/demos/Examples/MarkdownShortcuts/index.spec.js # docs/src/demos/Extensions/Blockquote/index.spec.js # docs/src/demos/Extensions/Bold/index.spec.js # docs/src/demos/Extensions/Code/index.spec.js # docs/src/demos/Extensions/CodeBlock/index.spec.js # docs/src/demos/Extensions/HardBreak/index.spec.js # docs/src/demos/Extensions/Heading/index.spec.js # docs/src/demos/Extensions/History/index.spec.js # docs/src/demos/Extensions/HorizontalRule/index.spec.js # docs/src/demos/Extensions/Italic/index.spec.js # docs/src/demos/Extensions/Paragraph/index.spec.js # docs/src/demos/Extensions/Strike/index.spec.js # docs/src/demos/Extensions/Underline/index.spec.js
30 lines
962 B
JavaScript
30 lines
962 B
JavaScript
context('/api/extensions/hard-break', () => {
|
|
before(() => {
|
|
cy.visit('/api/extensions/hard-break')
|
|
})
|
|
|
|
beforeEach((done) => {
|
|
cy.get('.ProseMirror').then(([{ editor }]) => {
|
|
editor.setContent('<p>Example Text</p>')
|
|
done()
|
|
})
|
|
})
|
|
|
|
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')
|
|
})
|
|
}) |