X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/3303f7533b86892774f011ac54bfd69c6092ea5a..a91d838aca2cb6b1330454a6e92616a73a2e1255:/modules/documentCanvas/canvas/canvas.test3.js diff --git a/modules/documentCanvas/canvas/canvas.test3.js b/modules/documentCanvas/canvas/canvas.test3.js index 9a549df..597fec2 100644 --- a/modules/documentCanvas/canvas/canvas.test3.js +++ b/modules/documentCanvas/canvas/canvas.test3.js @@ -485,6 +485,27 @@ describe('Canvas', function() { expect(list2.children().length).to.equal(1, 'second list has one child'); expect(list2.children()[0].children()[0].getText()).to.equal('3', 'first item of the second list is a last item of the original list'); }); + + it('removes list if all its items are extracted', function() { + var c = canvas.fromXML('\ +
\ +
\ +
some item
\ +
\ +
'), + list = c.doc().children()[0], + item = list.children()[0]; + + c.list.extractItems({element1: item, element2: item}); + + var section = c.doc(), + list1 = section.children()[0], + oldItem1 = section.children()[1], + oldItem2 = section.children()[2], + list2 = section.children()[3]; + + expect(section.children().length).to.equal(1, 'section contains one child'); + }); }); });