mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-27 00:54:22 +02:00
add tests (#3535)
This commit is contained in:
19
packages/slate/test/interfaces/Node/first/success.js
Normal file
19
packages/slate/test/interfaces/Node/first/success.js
Normal file
@@ -0,0 +1,19 @@
|
||||
/** @jsx jsx */
|
||||
|
||||
import { Node } from 'slate'
|
||||
import { jsx } from 'slate-hyperscript'
|
||||
|
||||
export const input = (
|
||||
<editor>
|
||||
<element>
|
||||
<text key="a" />
|
||||
<text key="b" />
|
||||
</element>
|
||||
</editor>
|
||||
)
|
||||
|
||||
export const test = value => {
|
||||
return Node.first(value, [0])
|
||||
}
|
||||
|
||||
export const output = [<text key="a" />, [0, 0]]
|
19
packages/slate/test/interfaces/Node/last/success.js
Normal file
19
packages/slate/test/interfaces/Node/last/success.js
Normal file
@@ -0,0 +1,19 @@
|
||||
/** @jsx jsx */
|
||||
|
||||
import { Node } from 'slate'
|
||||
import { jsx } from 'slate-hyperscript'
|
||||
|
||||
export const input = (
|
||||
<editor>
|
||||
<element>
|
||||
<text key="a" />
|
||||
<text key="b" />
|
||||
</element>
|
||||
</editor>
|
||||
)
|
||||
|
||||
export const test = value => {
|
||||
return Node.last(value, [0])
|
||||
}
|
||||
|
||||
export const output = [<text key="b" />, [0, 1]]
|
Reference in New Issue
Block a user