| 56 | * @param {t.TestCase} _tc |
| 57 | */ |
| 58 | export const testInsertionsMindingAttributedContent = _tc => { |
| 59 | const ydoc = new Y.Doc() |
| 60 | const ytext = ydoc.get() |
| 61 | ytext.insert(0, 'hello world') |
| 62 | const v1 = Y.cloneDoc(ydoc) |
| 63 | ydoc.transact(() => { |
| 64 | ytext.delete(6, 5) |
| 65 | }) |
| 66 | const am = Y.createAttributionManagerFromDiff(v1, ydoc) |
| 67 | const c1 = ytext.toDelta(am) |
| 68 | t.compare(c1, delta.create().insert('hello ').insert('world', null, { delete: [] })) |
| 69 | ytext.applyDelta(delta.create().retain(11).insert('content'), am) |
| 70 | t.assert(ytext.toString() === 'hello content') |
| 71 | } |
| 72 | |
| 73 | /** |
| 74 | * @param {t.TestCase} _tc |
nothing calls this directly
no test coverage detected
searching dependent graphs…