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:
@@ -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>
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user