test case
This commit is contained in:
parent
63aafba52b
commit
d5602190e3
@ -1673,6 +1673,29 @@ export const testDeltaAfterConcurrentFormatting = tc => {
|
|||||||
t.compare(deltas, [[{ retain: 3, attributes: { bold: true } }, { retain: 2, attributes: { bold: null } }]])
|
t.compare(deltas, [[{ retain: 3, attributes: { bold: true } }, { retain: 2, attributes: { bold: null } }]])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {t.TestCase} tc
|
||||||
|
*/
|
||||||
|
export const testDeltaAfterDelete = tc => {
|
||||||
|
const { text0, text1, testConnector } = init(tc, { users: 2 })
|
||||||
|
text0.insert(0, 'abc', {bold: true});
|
||||||
|
text0.insertEmbed(3, new Y.Map([['key', 'val']]));
|
||||||
|
testConnector.flushAllMessages()
|
||||||
|
/**
|
||||||
|
* @type {any}
|
||||||
|
*/
|
||||||
|
const deltas = []
|
||||||
|
text1.observe(event => {
|
||||||
|
if (event.delta.length > 0) {
|
||||||
|
deltas.push(event.delta)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
text0.delete(0, 3);
|
||||||
|
testConnector.flushAllMessages()
|
||||||
|
console.error("The actual deltas", deltas);
|
||||||
|
t.compare(deltas, [[{ delete: 3}]])
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {t.TestCase} tc
|
* @param {t.TestCase} tc
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user