1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-03-24 23:29:47 +01:00

add test case to cover issue from #4103 (#4292)

Landing this without a changeset as it's simply a test to cover a previously accepted fix.
This commit is contained in:
Luke Murray 2021-08-05 12:54:41 -04:00 committed by GitHub
parent 8def57665c
commit e6faf8e08d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,29 @@
/** @jsx jsx */
import { Editor } from 'slate'
import { jsx } from '../../../..'
export const input = (
<editor>
<block>
<text />
<inline>o</inline>
<text />
</block>
</editor>
)
export const test = editor => {
return Array.from(
Editor.positions(editor, {
at: Editor.range(editor, []),
unit: 'character',
})
)
}
// this is the output but it's incorrect.
// there should be two positions, before the character and after the character
export const output = [
{ path: [0, 0], offset: 0 },
{ path: [0, 1, 0], offset: 1 },
]