mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
easysync tests: add some more smartOpAssembler tests
This commit is contained in:
parent
2301fdda8a
commit
97e9ea3f62
1 changed files with 34 additions and 0 deletions
|
@ -92,6 +92,40 @@ describe('easysync-assembler', function () {
|
||||||
expect(assem.toString()).to.equal('-k');
|
expect(assem.toString()).to.equal('-k');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('smartOpAssembler append - op with text', async function () {
|
||||||
|
const assem = Changeset.smartOpAssembler();
|
||||||
|
const pool = poolOrArray([
|
||||||
|
'attr1,1',
|
||||||
|
'attr2,2',
|
||||||
|
'attr3,3',
|
||||||
|
'attr4,4',
|
||||||
|
'attr5,5',
|
||||||
|
]);
|
||||||
|
|
||||||
|
assem.appendOpWithText('-', 'test', '*3*4*5', pool);
|
||||||
|
assem.appendOpWithText('-', 'test', '*3*4*5', pool);
|
||||||
|
assem.appendOpWithText('-', 'test', '*1*4*5', pool);
|
||||||
|
assem.endDocument();
|
||||||
|
expect(assem.toString()).to.equal('*3*4*5-8*1*4*5-4');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('smartOpAssembler append - op with multiline text', async function () {
|
||||||
|
const assem = Changeset.smartOpAssembler();
|
||||||
|
const pool = poolOrArray([
|
||||||
|
'attr1,1',
|
||||||
|
'attr2,2',
|
||||||
|
'attr3,3',
|
||||||
|
'attr4,4',
|
||||||
|
'attr5,5',
|
||||||
|
]);
|
||||||
|
|
||||||
|
assem.appendOpWithText('-', 'test\ntest', '*3*4*5', pool);
|
||||||
|
assem.appendOpWithText('-', '\ntest\n', '*3*4*5', pool);
|
||||||
|
assem.appendOpWithText('-', '\ntest', '*1*4*5', pool);
|
||||||
|
assem.endDocument();
|
||||||
|
expect(assem.toString()).to.equal('*3*4*5|3-f*1*4*5|1-1*1*4*5-4');
|
||||||
|
});
|
||||||
|
|
||||||
it('smartOpAssembler append + op with text', async function () {
|
it('smartOpAssembler append + op with text', async function () {
|
||||||
const assem = Changeset.smartOpAssembler();
|
const assem = Changeset.smartOpAssembler();
|
||||||
const pool = poolOrArray([
|
const pool = poolOrArray([
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue