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:
@@ -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
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
|
||||
nodes:
|
||||
- kind: block
|
||||
type: image
|
||||
isVoid: true
|
||||
data:
|
||||
src: hello.png
|
@@ -0,0 +1,7 @@
|
||||
|
||||
nodes:
|
||||
- kind: block
|
||||
type: image
|
||||
isVoid: true
|
||||
data:
|
||||
src: hello.png
|
Reference in New Issue
Block a user