From 76a6047af690781b8238ba7924279470ba76d081 Mon Sep 17 00:00:00 2001 From: Keyamoon Date: Thu, 20 Dec 2012 03:18:47 +0330 Subject: 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(). --- test/jqLiteSpec.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'test/jqLiteSpec.js') diff --git a/test/jqLiteSpec.js b/test/jqLiteSpec.js index 01f9b9ae..b23e23eb 100644 --- a/test/jqLiteSpec.js +++ b/test/jqLiteSpec.js @@ -1,4 +1,3 @@ - describe('jqLite', function() { var scope, a, b, c; @@ -1073,6 +1072,14 @@ describe('jqLite', function() { var i = element.find('i'); expect(b.next()).toJqEqual([i]); }); + + + it('should ignore non-element siblings', function() { + var element = jqLite('