X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/58f12279b796c932263a4cfad12c3f17695be02a..d8d27d292d0a34cf24f48c769f6bebcb8273fa1d:/modules/documentCanvas/tests/canvas.test.js?ds=inline
diff --git a/modules/documentCanvas/tests/canvas.test.js b/modules/documentCanvas/tests/canvas.test.js
index afe777a..12fb8a5 100644
--- a/modules/documentCanvas/tests/canvas.test.js
+++ b/modules/documentCanvas/tests/canvas.test.js
@@ -61,6 +61,22 @@ define([
assertDomEqual(c.getContent(), '
\
'));
- var item = c.findNodes({klass: 'item'})[1];
- assert.ok(c.nodeInsideList({node: item}));
+ assert.ok(c.nodeInsideList({node: c.findNodes({klass: 'item'})[1]}), 'item is inside a list');
+ assert.ok(c.nodeInsideList({node: c.findNodes({tag: 'span'})[0]}), 'things nested in item are inside a list');
+ });
+
+ test('moving items to nested list', function() {
+ var listHTML = utils.cleanUp('\
+
\
+
alice
\
+
cat
\
+
dog
\
+
bee
\
+
');
+ var c = canvas.create(listHTML);
+ var items = c.findNodes({klass: 'item'});
+ var cat_item = items[1];
+ var dog_item = items[2];
+
+ c.listCreate({start: cat_item, end: dog_item});
+
+ assertDomEqual(c.getContent(), utils.cleanUp('\
+
'
+ ));
+ });
+
+ test('removing nested list', function() {
+ var nestedList = utils.cleanUp('\
+
');
+
+ var c = canvas.create(nestedList);
+ var dog_item = c.findNodes('[wlxml-class=list-items] [wlxml-class=list-items] > div')[1];
+ assert.equal(dog_item.getContent(), 'dog');
+
+ c.listRemove({pointer: dog_item});
+
+ assertDomEqual(c.getContent(), utils.cleanUp('\
+
\
+
alice
\
+
cat
\
+
dog
\
+
bee
\
+
'));
+
+
});
});
});
\ No newline at end of file