1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-31 02:49:56 +02:00

Add failing test for undo of joinNode

This commit is contained in:
Samy Pessé
2016-11-03 18:46:00 +01:00
parent fed0a6dd3d
commit 550a17cf26
3 changed files with 46 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
import assert from 'assert'
export default function (state) {
const { selection } = state
const next = state
.transform()
.joinNodeByKey('key2', 'key1')
.apply()
.transform()
.undo()
.apply()
assert.deepEqual(next.selection.toJS(), selection.toJS())
return next
}

View File

@@ -0,0 +1,14 @@
nodes:
- kind: block
key: 'key1'
type: paragraph
nodes:
- kind: text
text: The
- kind: block
key: 'key2'
type: paragraph
nodes:
- kind: text
text: text

View File

@@ -0,0 +1,14 @@
nodes:
- kind: block
key: 'key1'
type: paragraph
nodes:
- kind: text
text: The
- kind: block
key: 'key2'
type: paragraph
nodes:
- kind: text
text: text