| 103 | * @param {t.TestCase} _tc |
| 104 | */ |
| 105 | export const testLengthIssue2 = _tc => { |
| 106 | const doc = new Y.Doc() |
| 107 | const next = doc.get() |
| 108 | doc.transact(() => { |
| 109 | next.insert(0, ['group2']) |
| 110 | }) |
| 111 | doc.transact(() => { |
| 112 | next.insert(1, ['rectangle3']) |
| 113 | }) |
| 114 | doc.transact(() => { |
| 115 | next.delete(0) |
| 116 | next.insert(0, ['rectangle3']) |
| 117 | }) |
| 118 | next.delete(1) |
| 119 | doc.transact(() => { |
| 120 | next.insert(1, ['ellipse4']) |
| 121 | }) |
| 122 | doc.transact(() => { |
| 123 | next.insert(2, ['ellipse3']) |
| 124 | }) |
| 125 | doc.transact(() => { |
| 126 | next.insert(3, ['ellipse2']) |
| 127 | }) |
| 128 | doc.transact(() => { |
| 129 | doc.transact(() => { |
| 130 | t.fails(() => { |
| 131 | next.insert(5, ['rectangle2']) |
| 132 | }) |
| 133 | next.insert(4, ['rectangle2']) |
| 134 | }) |
| 135 | doc.transact(() => { |
| 136 | // this should not throw an error message |
| 137 | next.delete(4) |
| 138 | }) |
| 139 | }) |
| 140 | console.log(next.toArray()) |
| 141 | } |
| 142 | |
| 143 | /** |
| 144 | * @param {t.TestCase} tc |