mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-09-01 03:11:44 +02:00
Add failing test for undo of joinNode
This commit is contained in:
@@ -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
|
||||||
|
}
|
@@ -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
|
@@ -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
|
Reference in New Issue
Block a user