From 715daf96dcdde602fbd98fb6e5a165fc4698658c Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Tue, 1 Sep 2020 15:45:05 +0200 Subject: [PATCH] fix tests --- docs/src/demos/Examples/Basic/index.spec.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/docs/src/demos/Examples/Basic/index.spec.js b/docs/src/demos/Examples/Basic/index.spec.js index e6d7434d..12ce3f68 100644 --- a/docs/src/demos/Examples/Basic/index.spec.js +++ b/docs/src/demos/Examples/Basic/index.spec.js @@ -1,13 +1,23 @@ context('basic', () => { beforeEach(() => { cy.visit('/examples/basic') + + cy.get('.ProseMirror').window().then(window => { + const { editor } = window + editor.setContent('

foo

') + }) }) describe('export', () => { + it('set the content to something simple', () => { + cy.get('.ProseMirror').window().then(window => { + const { editor } = window + }) + }) + it('should return html', () => { cy.get('.ProseMirror').window().then(window => { const { editor } = window - editor.setContent('

foo

') const html = editor.html() expect(html).to.equal('

foo

') @@ -17,7 +27,6 @@ context('basic', () => { it('should return json', () => { cy.get('.ProseMirror').window().then(window => { const { editor } = window - editor.setContent('

foo

') const json = editor.json() expect(json).to.deep.equal({ @@ -43,7 +52,7 @@ context('basic', () => { cy.get('.ProseMirror').window().then(window => { const { editor } = window - editor.insertText('bar') + editor.focus(1).insertText('bar') cy.get('.ProseMirror p:first').should('contain', 'barfoo') }) }) @@ -62,7 +71,6 @@ context('basic', () => { it('should prepend', () => { cy.get('.ProseMirror').window().then(window => { const { editor } = window - editor.setContent('

foo

') editor.focus('start').insertHTML('

bar

') cy.get('.ProseMirror p:first').should('contain', 'bar').should('not.contain', 'foo') @@ -73,7 +81,6 @@ context('basic', () => { it('should append', () => { cy.get('.ProseMirror').window().then(window => { const { editor } = window - editor.setContent('

foo

') editor.focus('end').insertHTML('

bar

') cy.get('.ProseMirror p:first').should('contain', 'foo').should('not.contain', 'bar')