From 2fe6422ba585c0051df9c79b5f5a9e04830911d2 Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Tue, 12 Jan 2021 17:25:15 +0100 Subject: [PATCH] add a broken test (wip) --- docs/src/demos/Nodes/CodeBlock/index.spec.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/docs/src/demos/Nodes/CodeBlock/index.spec.js b/docs/src/demos/Nodes/CodeBlock/index.spec.js index 2ebd421a2..4902cb9a4 100644 --- a/docs/src/demos/Nodes/CodeBlock/index.spec.js +++ b/docs/src/demos/Nodes/CodeBlock/index.spec.js @@ -33,7 +33,7 @@ context('/api/nodes/code-block', () => { .should('contain', 'Example Text') }) - it('the button should toggle the code block', () => { + it('toggles the code block when pressing the button', () => { cy.get('.demo__preview button:first') .click() @@ -51,6 +51,21 @@ context('/api/nodes/code-block', () => { .should('not.exist') }) + it.only('transforms multiple nodes to one code block', () => { + cy.get('.ProseMirror').then(([{ editor }]) => { + editor.commands.setContent('

Example paragraph

Another example paragraph

') + editor.commands.selectAll() + }) + + cy.get('.demo__preview button:first') + .click() + + cy.get('.ProseMirror') + .find('pre') + .its('length') + .should('eq', 1) + }) + it('the keyboard shortcut should make the selected line a code block', () => { cy.get('.ProseMirror') .trigger('keydown', { modKey: true, altKey: true, key: 'c' })