mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-20 22:21:20 +02:00
Test splitNode undo
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
|
||||
import assert from 'assert'
|
||||
|
||||
export default function (state) {
|
||||
const { selection } = state
|
||||
|
||||
let next = state
|
||||
.transform()
|
||||
.splitNodeByKey('key1', 3)
|
||||
.apply()
|
||||
|
||||
next = next
|
||||
.transform()
|
||||
.undo()
|
||||
.apply()
|
||||
|
||||
assert.deepEqual(next.selection.toJS(), selection.toJS())
|
||||
return next
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
|
||||
nodes:
|
||||
- kind: block
|
||||
key: 'key1'
|
||||
type: paragraph
|
||||
nodes:
|
||||
- kind: text
|
||||
text: Thetext
|
@@ -0,0 +1,8 @@
|
||||
|
||||
nodes:
|
||||
- kind: block
|
||||
key: 'key1'
|
||||
type: paragraph
|
||||
nodes:
|
||||
- kind: text
|
||||
text: Thetext
|
Reference in New Issue
Block a user