mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-17 20:51:20 +02:00
add void node removal tests
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
/** @jsx jsx */
|
||||
|
||||
import { Editor } from 'slate'
|
||||
import { jsx } from '../../..'
|
||||
|
||||
export const input = (
|
||||
<editor>
|
||||
<block void>
|
||||
<cursor />
|
||||
one
|
||||
</block>
|
||||
</editor>
|
||||
)
|
||||
|
||||
export const run = editor => {
|
||||
Editor.removeNodes(editor, { at: [0] })
|
||||
}
|
||||
|
||||
export const output = <editor />
|
@@ -0,0 +1,29 @@
|
||||
/** @jsx jsx */
|
||||
|
||||
import { Editor } from 'slate'
|
||||
import { jsx } from '../../..'
|
||||
|
||||
export const input = (
|
||||
<editor>
|
||||
<block void>
|
||||
<cursor />
|
||||
one
|
||||
</block>
|
||||
<block>two</block>
|
||||
<block>three</block>
|
||||
</editor>
|
||||
)
|
||||
|
||||
export const run = editor => {
|
||||
Editor.removeNodes(editor, { at: [0] })
|
||||
}
|
||||
|
||||
export const output = (
|
||||
<editor>
|
||||
<block>
|
||||
<cursor />
|
||||
two
|
||||
</block>
|
||||
<block>three</block>
|
||||
</editor>
|
||||
)
|
Reference in New Issue
Block a user