Skip to content
This repository has been archived by the owner on Apr 21, 2021. It is now read-only.

Issue: Multiple nodes should become one code block #87

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions docs/src/demos/Nodes/CodeBlock/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,21 @@ context('/demos/Nodes/CodeBlock', () => {
.should('not.exist')
})

it.only('transforms multiple nodes to one code block', () => {
cy.get('.ProseMirror').then(([{ editor }]) => {
editor.commands.setContent('<p>Example paragraph</p><p>Another example paragraph</p>')
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' })
Expand Down