1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-22 15:02:51 +02:00

Change operation tests to take a list of operations

This commit is contained in:
Justin Weiss
2018-01-10 15:36:09 -08:00
parent a6b069603f
commit 4781a0ea66
2 changed files with 9 additions and 11 deletions

View File

@@ -2,15 +2,13 @@
import h from '../../../helpers/h'
export default function (change) {
return change.applyOperation({
export default [{
type: 'remove_text',
path: [0, 0],
offset: 2,
text: 'is is some text inside ',
marks: []
})
}
}]
export const input = (
<value>

View File

@@ -26,9 +26,9 @@ describe('operations', async () => {
it(test, async () => {
const module = require(resolve(testDir, test))
const { input, output } = module
const fn = module.default
const operations = module.default
const change = input.change()
fn(change)
change.applyOperations(operations)
const opts = { preserveSelection: true, preserveData: true }
const actual = change.value.toJSON(opts)
const expected = output.toJSON(opts)