Add ydoc.getXmlElement

This commit is contained in:
Raine Revere
2024-02-05 13:24:11 +00:00
parent 415a645874
commit 16d9638bc8
3 changed files with 27 additions and 0 deletions

View File

@@ -210,3 +210,16 @@ export const testFormattingBug = _tc => {
yxml.applyDelta(delta)
t.compare(yxml.toDelta(), delta)
}
/**
* @param {t.TestCase} _tc
*/
export const testElement = _tc => {
const ydoc = new Y.Doc()
const yxmlel = ydoc.getXmlElement()
const text1 = new Y.XmlText('text1')
const text2 = new Y.XmlText('text2')
yxmlel.insert(0, [text1, text2])
t.compareArrays(yxmlel.toArray(), [text1, text2])
}