mirror of
https://github.com/yjs/yjs.git
synced 2026-08-29 10:09:05 +02:00
remove insertAfter
This commit is contained in:
@@ -85,34 +85,6 @@ export const testSiblings = _tc => {
|
||||
t.assert(yxml.parent === null)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {t.TestCase} _tc
|
||||
*/
|
||||
export const testInsertafter = _tc => {
|
||||
const ydoc = new Y.Doc()
|
||||
const yxml = ydoc.get()
|
||||
const first = new Y.Type()
|
||||
const second = new Y.Type('p')
|
||||
const third = new Y.Type('p')
|
||||
const deepsecond1 = new Y.Type('span')
|
||||
const deepsecond2 = new Y.Type()
|
||||
yxml.insertAfter(null, [first, second])
|
||||
yxml.insertAfter(second, [third])
|
||||
second.insertAfter(null, [deepsecond1])
|
||||
second.insertAfter(deepsecond1, [deepsecond2])
|
||||
|
||||
t.assert(yxml.length === 3)
|
||||
t.assert(second.get(0) === deepsecond1)
|
||||
t.assert(second.get(1) === deepsecond2)
|
||||
|
||||
t.compareArrays(yxml.toArray(), [first, second, third])
|
||||
|
||||
t.fails(() => {
|
||||
const el = new Y.Type('p')
|
||||
el.insertAfter(deepsecond1, [new Y.Type()])
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {t.TestCase} _tc
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user