1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-17 20:51:20 +02:00

Add unit test for undo of setNodeByKey

This commit is contained in:
Samy Pessé
2016-11-01 11:53:36 +01:00
parent 925189eb94
commit af6b0e0388
3 changed files with 31 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
export default function (state) {
const { document } = state
const next = state
.transform()
.setNodeByKey(document.nodes.first().key, {
data: { src: 'world.png' }
})
.apply()
.transform()
.undo()
.apply()
return next
}

View File

@@ -0,0 +1,7 @@
nodes:
- kind: block
type: image
isVoid: true
data:
src: hello.png

View File

@@ -0,0 +1,7 @@
nodes:
- kind: block
type: image
isVoid: true
data:
src: hello.png