type fixes

This commit is contained in:
Kevin Jahns
2026-02-23 20:22:40 +01:00
parent 8cd979af63
commit e3ba2cbab4
3 changed files with 15 additions and 381 deletions

View File

@@ -100,13 +100,14 @@ export const testYdocDiff = () => {
ydocUpdated.get('map').setAttr('newk', 42)
ydocUpdated.get('map').getAttr('nested').insert(0, [1])
// @todo add custom attribution
const d = Y.diffDocsToDelta(ydocStart, ydocUpdated)
const d = Y.diffDocsToDelta(ydocStart, ydocUpdated).done()
console.log('calculated diff', d.toJSON())
t.compare(d, delta.create()
const expected = delta.create()
.modifyAttr('text', delta.create().retain(5).insert(' world', null, { insert: [] }))
.modifyAttr('array', delta.create().retain(1).insert(['x'], null, { insert: [] }))
.modifyAttr('map', delta.create().setAttr('newk', 42, { insert: [] }).modifyAttr('nested', delta.create().insert([1], null, { insert: [] })))
)
const expectedDone = expected.done()
t.compare(d, expectedDone)
}
export const testChildListContent = () => {