feat: add test annotations

This commit is contained in:
cudr
2019-10-10 22:45:31 +03:00
parent ab3b8c4ee3
commit 2a4d64b074
10 changed files with 153 additions and 24 deletions

View File

@@ -15,18 +15,20 @@ const insertNodeOp = ({ value, obj, index, path }: Automerge.Diff) => map => {
const inserate = ({ nodes, ...json }: any, path) => {
const node = nodes ? { ...json, nodes: [] } : json
if (node.object === 'mark') {
ops.push({
type: 'add_mark',
path: path.slice(0, -1),
mark: node
})
} else {
ops.push({
type: 'insert_node',
path,
node
})
if (node.object) {
if (node.object === 'mark') {
ops.push({
type: 'add_mark',
path: path.slice(0, -1),
mark: node
})
} else {
ops.push({
type: 'insert_node',
path,
node
})
}
}
nodes && nodes.forEach((n, i) => inserate(n, [...path, i]))

View File

@@ -21,7 +21,7 @@ const opSet = (op: Automerge.Diff, [map, ops]) => {
if (set && path) {
ops.push(set(op))
} else {
} else if (map[obj]) {
map[obj][key] = link ? map[value] : value
}