From 78cc76c1a6d9edcc0a6eee455412b0a53c50fdeb Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Thu, 8 Oct 2020 03:51:39 +0200 Subject: [PATCH] test bold parseDOM rules --- docs/src/demos/Extensions/Bold/index.spec.js | 30 ++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/docs/src/demos/Extensions/Bold/index.spec.js b/docs/src/demos/Extensions/Bold/index.spec.js index da2d4f48..7e22cda1 100644 --- a/docs/src/demos/Extensions/Bold/index.spec.js +++ b/docs/src/demos/Extensions/Bold/index.spec.js @@ -10,6 +10,36 @@ context('/api/extensions/bold', () => { }) }) + it('b tags should be transformed to strong tags', () => { + cy.get('.ProseMirror').then(([{ editor }]) => { + editor.setContent('

Example Text

') + expect(editor.html()).to.eq('

Example Text

') + }) + }) + + it('b tags with normal font weight inline style should be omitted', () => { + cy.get('.ProseMirror').then(([{ editor }]) => { + editor.setContent('

Example Text

') + expect(editor.html()).to.eq('

Example Text

') + }) + }) + + it('generic tags with bold inline style should be transformed to strong tags', () => { + cy.get('.ProseMirror').then(([{ editor }]) => { + editor.setContent('

Example Text

') + expect(editor.html()).to.eq('

Example Text

') + + editor.setContent('

Example Text

') + expect(editor.html()).to.eq('

Example Text

') + + editor.setContent('

Example Text

') + expect(editor.html()).to.eq('

Example Text

') + + editor.setContent('

Example Text

') + expect(editor.html()).to.eq('

Example Text

') + }) + }) + it('the button should make the selected text bold', () => { cy.get('.demo__preview button:first') .click()