X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/21cd91531dd9c6e88d00da03f6b2f3ad88fb0da0..d3d80ba74ca2e2afbd262edfe4be39010c86ebde:/src/wlxml/extensions/list/list.test.js?ds=inline
diff --git a/src/wlxml/extensions/list/list.test.js b/src/wlxml/extensions/list/list.test.js
index fd6089e..396600b 100644
--- a/src/wlxml/extensions/list/list.test.js
+++ b/src/wlxml/extensions/list/list.test.js
@@ -60,6 +60,15 @@ describe('Lists extension', function() {
expect(child3.contents()[0].getText()).to.equal('cat');
});
+ it('Handles text nodes on the boundries', function() {
+ var doc = getDocumentFromXML(''),
+ textNode1 = doc.root.contents()[0],
+ textNode2 = doc.root.contents()[2];
+ doc.createList({node1: textNode1, node2: textNode2});
+ expect(doc.root.contents().length).to.equal(1);
+ expect(doc.root.contents()[0].is('list')).to.equal(true);
+ });
+
it('allows creating nested list from existing sibling list items', function() {
var doc = getDocumentFromXML('\
\
@@ -148,8 +157,7 @@ describe('Lists extension', function() {
')),
list = doc.root.contents()[0],
item1 = list.contents()[0],
- item2 = list.contents()[1],
- item3 = list.contents()[2];
+ item2 = list.contents()[1];
doc.extractItems({item1: item1, item2: item2});
@@ -175,7 +183,6 @@ describe('Lists extension', function() {
\
')),
list = doc.root.contents()[0],
- item1 = list.contents()[0],
item2 = list.contents()[1],
item3 = list.contents()[2];