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:
parent
ad2642a3b5
commit
71befd0202
15
test/behavior/fixtures/on-select/move-selection/index.js
Normal file
15
test/behavior/fixtures/on-select/move-selection/index.js
Normal 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 })
|
||||
}
|
17
test/behavior/fixtures/on-select/move-selection/input.yaml
Normal file
17
test/behavior/fixtures/on-select/move-selection/input.yaml
Normal 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
|
17
test/behavior/fixtures/on-select/move-selection/output.yaml
Normal file
17
test/behavior/fixtures/on-select/move-selection/output.yaml
Normal 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
|
Loading…
x
Reference in New Issue
Block a user