aboutsummaryrefslogtreecommitdiffstats
path: root/test/jqLiteSpec.js
diff options
context:
space:
mode:
authorKeyamoon2012-12-20 03:18:47 +0330
committerIgor Minar2013-01-08 14:54:56 -0800
commitc0995399d4226504069f1b9e378260d0553c1fcc (patch)
tree037fcb394f44bca3267823cbe7c992b9fa02729c /test/jqLiteSpec.js
parentde6cc287e51dcdd91c63d7427dbdc28cae111ad5 (diff)
downloadangular.js-c0995399d4226504069f1b9e378260d0553c1fcc.tar.bz2
fix(jqLite): make next() ignore non-element nodes
next() is supposed to return the next sibling *element* so it should ignore text nodes. To achieve this, nextElementSibling() should be used instead of nextSibling().
Diffstat (limited to 'test/jqLiteSpec.js')
-rw-r--r--test/jqLiteSpec.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/jqLiteSpec.js b/test/jqLiteSpec.js
index 76a2c5a8..a5e7b34e 100644
--- a/test/jqLiteSpec.js
+++ b/test/jqLiteSpec.js
@@ -1,4 +1,3 @@
-
describe('jqLite', function() {
var scope, a, b, c;
@@ -1068,6 +1067,14 @@ describe('jqLite', function() {
var i = element.find('i');
expect(b.next()).toJqEqual([i]);
});
+
+
+ it('should ignore non-element siblings', function() {
+ var element = jqLite('<div><b>b</b>TextNode<!-- comment node --><i>i</i></div>');
+ var b = element.find('b');
+ var i = element.find('i');
+ expect(b.next()).toJqEqual([i]);
+ });
});