Test for canvas.nodeInsideList
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Thu, 27 Jun 2013 11:01:45 +0000 (13:01 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Thu, 27 Jun 2013 11:01:45 +0000 (13:01 +0200)
modules/documentCanvas/tests/canvas.test.js

index 0589c11..afe777a 100644 (file)
@@ -174,5 +174,17 @@ define([
                     <div wlxml-tag="div">cat</div>\\r
                 </div>'));\r
         });\r
+        \r
+        test('checking if node is inside a list', function() {\r
+            var c = canvas.create(utils.cleanUp('\\r
+                <div wlxml-tag="section">\\r
+                    <div wlxml-tag="div" wlxml-class="list-items-enum">\\r
+                        <div wlxml-tag="div" wlxml-class="item">alice</div>\\r
+                        <div wlxml-tag="div" wlxml-class="item">cat</div>\\r
+                    </div>\\r
+                </div>'));\r
+            var item = c.findNodes({klass: 'item'})[1];\r
+            assert.ok(c.nodeInsideList({node: item}));\r
+        });\r
     });\r
 });
\ No newline at end of file