diff --git a/packages/slate/test/queries/match/props/block-nested.js b/packages/slate/test/queries/match/props/block-nested.js new file mode 100644 index 000000000..f0f643e90 --- /dev/null +++ b/packages/slate/test/queries/match/props/block-nested.js @@ -0,0 +1,23 @@ +/** @jsx jsx */ + +import { Editor } from 'slate' +import { jsx } from '../../..' + +export const input = ( + + + one + + +) + +export const run = editor => { + return Editor.match(editor, [0, 0, 0], { a: true }) +} + +export const output = [ + + one + , + [0], +] diff --git a/packages/slate/test/queries/match/props/block-with-many.js b/packages/slate/test/queries/match/props/block-with-many.js new file mode 100644 index 000000000..3dd7c31e9 --- /dev/null +++ b/packages/slate/test/queries/match/props/block-with-many.js @@ -0,0 +1,23 @@ +/** @jsx jsx */ + +import { Editor } from 'slate' +import { jsx } from '../../..' + +export const input = ( + + + one + + +) + +export const run = editor => { + return Editor.match(editor, [0, 0], { a: true }) +} + +export const output = [ + + one + , + [0], +] diff --git a/packages/slate/test/queries/match/props/block.js b/packages/slate/test/queries/match/props/block.js new file mode 100644 index 000000000..50b578221 --- /dev/null +++ b/packages/slate/test/queries/match/props/block.js @@ -0,0 +1,16 @@ +/** @jsx jsx */ + +import { Editor } from 'slate' +import { jsx } from '../../..' + +export const input = ( + + one + +) + +export const run = editor => { + return Editor.match(editor, [0, 0], { a: true }) +} + +export const output = [one, [0]] diff --git a/packages/slate/test/queries/match/props/inline.js b/packages/slate/test/queries/match/props/inline.js new file mode 100644 index 000000000..cdc5f4bf9 --- /dev/null +++ b/packages/slate/test/queries/match/props/inline.js @@ -0,0 +1,23 @@ +/** @jsx jsx */ + +import { Editor } from 'slate' +import { jsx } from '../../..' + +export const input = ( + + + onetwothree + + +) + +export const run = editor => { + return Editor.match(editor, [0, 1, 0], { a: true }) +} + +export const output = [ + + onetwothree + , + [0], +] diff --git a/packages/slate/test/queries/match/props/match-multiple.js b/packages/slate/test/queries/match/props/match-multiple.js new file mode 100644 index 000000000..00adb4067 --- /dev/null +++ b/packages/slate/test/queries/match/props/match-multiple.js @@ -0,0 +1,23 @@ +/** @jsx jsx */ + +import { Editor } from 'slate' +import { jsx } from '../../..' + +export const input = ( + + + one + + +) + +export const run = editor => { + return Editor.match(editor, [0, 0], { a: true, b: true }) +} + +export const output = [ + + one + , + [0], +] diff --git a/packages/slate/test/transforms/insertNodes/void/at-path.js b/packages/slate/test/transforms/insertNodes/void/at-path.js new file mode 100644 index 000000000..96a23b49e --- /dev/null +++ b/packages/slate/test/transforms/insertNodes/void/at-path.js @@ -0,0 +1,33 @@ +/** @jsx jsx */ + +import { Editor } from 'slate' +import { jsx } from '../../..' + +export const input = ( + + + one + + + +) + +export const run = editor => { + Editor.insertNodes( + editor, + + two + , + { at: [1], select: true } + ) +} + +export const output = ( + + one + + two + + + +) diff --git a/packages/slate/test/transforms/insertNodes/void/block-nested.js b/packages/slate/test/transforms/insertNodes/void/block-nested.js new file mode 100644 index 000000000..65f8bcdd2 --- /dev/null +++ b/packages/slate/test/transforms/insertNodes/void/block-nested.js @@ -0,0 +1,38 @@ +/** @jsx jsx */ + +import { Editor } from 'slate' +import { jsx } from '../../..' + +export const input = ( + + + one + + + +) + +export const run = editor => { + Editor.insertNodes( + editor, + + + two + + + ) +} + +export const output = ( + + one + + + + two + + + + + +) diff --git a/packages/slate/test/transforms/deselect/unfocused.js b/packages/slate/test/transforms/insertNodes/void/block.js similarity index 54% rename from packages/slate/test/transforms/deselect/unfocused.js rename to packages/slate/test/transforms/insertNodes/void/block.js index 06c16a9a8..3e11d20ff 100644 --- a/packages/slate/test/transforms/deselect/unfocused.js +++ b/packages/slate/test/transforms/insertNodes/void/block.js @@ -1,23 +1,32 @@ /** @jsx jsx */ import { Editor } from 'slate' -import { jsx } from '../..' - -export const run = editor => { - Editor.deselect(editor) -} +import { jsx } from '../../..' export const input = ( - one + ) +export const run = editor => { + Editor.insertNodes( + editor, + + two + + ) +} + export const output = ( one + + two + + ) diff --git a/packages/slate/test/transforms/insertNodes/void/inline.js b/packages/slate/test/transforms/insertNodes/void/inline.js new file mode 100644 index 000000000..7a13116b7 --- /dev/null +++ b/packages/slate/test/transforms/insertNodes/void/inline.js @@ -0,0 +1,41 @@ +/** @jsx jsx */ + +import { Editor } from 'slate' +import { jsx } from '../../..' + +export const input = ( + + + one + + two + + + three + + +) + +export const run = editor => { + Editor.insertNodes( + editor, + + four + + ) +} + +export const output = ( + + + one + two + + + four + + + three + + +)