X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/58d1e96373dee3849af719bdedb3d57c51adc5c3..72006ca5628befdc32bb1cd31002f22c4a7c8bca:/modules/documentCanvas/canvas/canvas.test3.js diff --git a/modules/documentCanvas/canvas/canvas.test3.js b/modules/documentCanvas/canvas/canvas.test3.js index dc29f5d..56f8ee6 100644 --- a/modules/documentCanvas/canvas/canvas.test3.js +++ b/modules/documentCanvas/canvas/canvas.test3.js @@ -350,6 +350,29 @@ describe('Canvas', function() { }); }); + describe('Lists api', function() { + it('allows creation of a list from existing sibling DocumentElements', function() { + var c = canvas.fromXML('\ +
\ + Alice\ +
has
\ + a\ +
cat
\ +
'), + section = c.doc(), + textAlice = section.children()[0], + divCat = section.children()[3] + + c.list.create({element1: textAlice, element2: divCat}); + + expect(section.children().length).to.equal(1, 'section has one child element'); + + var list = section.children()[0]; + expect(list.is('list')).to.equal(true, 'section\'s only child is a list'); + expect(list.children().length).to.equal(4, 'list contains four elements'); + }); + }); + }); });