Files
tiptap/docs/src/tests/core/commands/clearContent.spec.js
Philipp Kühn 223ffaab1e fix tests
2021-01-21 17:40:50 +01:00

26 lines
644 B
JavaScript

context('clearContent', () => {
before(() => {
cy.visit('/examples/default')
})
it('returns true for the clearContent command', () => {
cy.get('.ProseMirror').then(([{ editor }]) => {
editor.commands.setContent('<p>Example Text</p>')
const command = editor.commands.clearContent()
expect(command).to.be.eq(true)
})
})
it('clears the content when using the clearContent command', () => {
cy.get('.ProseMirror').then(([{ editor }]) => {
editor.commands.setContent('<p>Example Text</p>')
editor.commands.clearContent()
expect(editor.getHTML()).to.be.eq('<p></p>')
})
})
})