1
0
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:
Soreine
2016-11-09 12:48:09 +01:00
parent 583b560ec3
commit 3b5cc17bfa
3 changed files with 35 additions and 0 deletions

View File

@@ -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
}

View File

@@ -0,0 +1,8 @@
nodes:
- kind: block
key: 'key1'
type: paragraph
nodes:
- kind: text
text: Thetext

View File

@@ -0,0 +1,8 @@
nodes:
- kind: block
key: 'key1'
type: paragraph
nodes:
- kind: text
text: Thetext