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

fix tests

This commit is contained in:
Ian Storm Taylor
2017-09-21 12:59:41 -07:00
parent a5f91ab7d4
commit 1320d56c4f
3 changed files with 15 additions and 14 deletions

View File

@@ -3,16 +3,17 @@
import h from '../../../helpers/h'
export default function (change) {
const key = '123'
const quote = { kind: 'block', type: 'quote' }
change.replaceNodeByKey(key, quote)
change.replaceNodeByKey('a', { kind: 'block', type: 'quote' })
}
export const input = (
<state>
<document>
<paragraph key="123">
word
<paragraph>
one
</paragraph>
<paragraph key="a">
two
</paragraph>
</document>
</state>
@@ -21,6 +22,9 @@ export const input = (
export const output = (
<state>
<document>
<paragraph>
one
</paragraph>
<quote />
</document>
</state>

View File

@@ -3,8 +3,7 @@
import h from '../../../helpers/h'
export default function (change) {
const quote = { kind: 'block', type: 'quote' }
change.replaceNodeByKey('a', quote)
change.replaceNodeByKey('a', { kind: 'inline', type: 'emoji', isVoid: true })
}
export const input = (
@@ -21,7 +20,7 @@ export const output = (
<state>
<document>
<paragraph>
one <quote />
one <emoji />
</paragraph>
</document>
</state>

View File

@@ -3,9 +3,7 @@
import h from '../../../helpers/h'
export default function (change) {
const key = change.state.document.getTexts().first().key
const text = { kind: 'text', text: 'three' }
change.replaceNodeByKey(key, text)
change.replaceNodeByKey('a', { kind: 'text', ranges: [{ text: 'three' }] })
}
export const input = (
@@ -15,7 +13,7 @@ export const input = (
one
</paragraph>
<paragraph>
two
<text key="a">one</text>
</paragraph>
</document>
</state>
@@ -25,10 +23,10 @@ export const output = (
<state>
<document>
<paragraph>
three
one
</paragraph>
<paragraph>
two
three
</paragraph>
</document>
</state>