mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-29 09:59:48 +02:00
Adapt test for unwrapInline across blocks
This commit is contained in:
@@ -21,17 +21,17 @@ export default function (state) {
|
||||
})
|
||||
.apply()
|
||||
|
||||
// Selection is reset, in theory it should me on the emoji
|
||||
first = next.document.getTexts().first()
|
||||
assert.deepEqual(
|
||||
next.selection.toJS(),
|
||||
range.merge({
|
||||
anchorKey: first.key,
|
||||
anchorOffset: 0,
|
||||
focusKey: first.key,
|
||||
focusOffset: 0
|
||||
}).toJS()
|
||||
)
|
||||
// Selection is reset, in theory it should me on the emoji
|
||||
first = next.document.getTexts().first()
|
||||
assert.deepEqual(
|
||||
next.selection.toJS(),
|
||||
range.merge({
|
||||
anchorKey: first.key,
|
||||
anchorOffset: 0,
|
||||
focusKey: first.key,
|
||||
focusOffset: 0
|
||||
}).toJS()
|
||||
)
|
||||
|
||||
return next
|
||||
}
|
||||
|
@@ -4,7 +4,7 @@ import assert from 'assert'
|
||||
export default function (state) {
|
||||
const { document, selection } = state
|
||||
const texts = document.getTexts()
|
||||
const first = texts.first()
|
||||
let first = texts.first()
|
||||
const second = texts.last()
|
||||
const range = selection.merge({
|
||||
anchorKey: first.key,
|
||||
@@ -19,9 +19,16 @@ export default function (state) {
|
||||
.unwrapInline('hashtag')
|
||||
.apply()
|
||||
|
||||
// Selection is reset, in theory it should me on the image
|
||||
first = next.document.getTexts().first()
|
||||
assert.deepEqual(
|
||||
next.selection.toJS(),
|
||||
range.toJS()
|
||||
range.merge({
|
||||
anchorKey: first.key,
|
||||
anchorOffset: 0,
|
||||
focusKey: first.key,
|
||||
focusOffset: 0
|
||||
}).toJS()
|
||||
)
|
||||
|
||||
return next
|
||||
|
Reference in New Issue
Block a user