From 0341eedae5f7f7249f0c595d8f05e4ac49203972 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Wed, 4 Mar 2020 10:34:07 +0100 Subject: [PATCH] add test --- cypress/integration/basic.spec.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/cypress/integration/basic.spec.js b/cypress/integration/basic.spec.js index 36ee7630..9922a830 100644 --- a/cypress/integration/basic.spec.js +++ b/cypress/integration/basic.spec.js @@ -43,8 +43,6 @@ context('basic', () => { editor.insertText('bar') cy.get('.ProseMirror p:first').should('contain', 'barfoo') - //.contains('barfoo') - // .should('contain', 'barfoo') }) }) @@ -57,12 +55,23 @@ context('basic', () => { }) }) + it('should prepend html', () => { + cy.get('.ProseMirror').window().then(window => { + const { editor } = window + + editor.focus('start').insertHTML('

bar

') + cy.get('.ProseMirror p:first').should('contain', 'bar').should('not.contain', 'foo') + cy.get('.ProseMirror p:last').should('contain', 'foo').should('not.contain', 'bar') + }) + }) + it('should append html', () => { cy.get('.ProseMirror').window().then(window => { const { editor } = window editor.focus('end').insertHTML('

bar

') - cy.get('.ProseMirror p:first').should('contain', 'foobar') + cy.get('.ProseMirror p:first').should('contain', 'foo').should('not.contain', 'bar') + cy.get('.ProseMirror p:last').should('contain', 'bar').should('not.contain', 'foo') }) }) })