1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-04-19 12:51:59 +02:00

add on-select behavior test

This commit is contained in:
Ian Storm Taylor 2016-12-09 12:44:12 -08:00
parent ad2642a3b5
commit 71befd0202
3 changed files with 49 additions and 0 deletions

View File

@ -0,0 +1,15 @@
import Simulate from '../../../../helpers/simulate'
import { Selection } from '../../../../..'
export default function (state, stack) {
const selection = Selection.create({
anchorKey: 'c',
anchorOffset: 1,
focusKey: 'c',
focusOffset: 1,
isFocused: true,
})
return Simulate.select(stack, state, null, { selection })
}

View File

@ -0,0 +1,17 @@
document:
key: a
nodes:
- key: b
kind: block
type: paragraph
nodes:
- key: c
kind: text
text: word
selection:
anchorKey: c
anchorOffset: 0
focusKey: c
focusOffset: 0
isFocused: true

View File

@ -0,0 +1,17 @@
document:
key: a
nodes:
- key: b
kind: block
type: paragraph
nodes:
- key: c
kind: text
text: word
selection:
anchorKey: c
anchorOffset: 1
focusKey: c
focusOffset: 1
isFocused: true