add content to the extensions overview, improve the basic example

This commit is contained in:
Hans Pagel
2020-08-31 17:34:09 +02:00
parent 30483257d1
commit f8e907783d
8 changed files with 63 additions and 30 deletions

View File

@@ -7,6 +7,7 @@ context('basic', () => {
it('should return html', () => {
cy.get('.ProseMirror').window().then(window => {
const { editor } = window
editor.setContent('<p>foo</p>')
const html = editor.html()
expect(html).to.equal('<p>foo</p>')
@@ -16,6 +17,7 @@ context('basic', () => {
it('should return json', () => {
cy.get('.ProseMirror').window().then(window => {
const { editor } = window
editor.setContent('<p>foo</p>')
const json = editor.json()
expect(json).to.deep.equal({
@@ -60,6 +62,7 @@ context('basic', () => {
it('should prepend', () => {
cy.get('.ProseMirror').window().then(window => {
const { editor } = window
editor.setContent('<p>foo</p>')
editor.focus('start').insertHTML('<p>bar</p>')
cy.get('.ProseMirror p:first').should('contain', 'bar').should('not.contain', 'foo')
@@ -70,6 +73,7 @@ context('basic', () => {
it('should append', () => {
cy.get('.ProseMirror').window().then(window => {
const { editor } = window
editor.setContent('<p>foo</p>')
editor.focus('end').insertHTML('<p>bar</p>')
cy.get('.ProseMirror p:first').should('contain', 'foo').should('not.contain', 'bar')