From 56c00800c78d3d896fa6cb97ab97b974805152c4 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Thu, 31 Mar 2011 01:17:34 -0700 Subject: fix jqLite#parent to be compatible with jQuery our original implementation doesn't work with document fragments on IE - tests were added to cover missing cases --- test/jqLiteSpec.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'test') diff --git a/test/jqLiteSpec.js b/test/jqLiteSpec.js index 346017f1..2fc670ce 100644 --- a/test/jqLiteSpec.js +++ b/test/jqLiteSpec.js @@ -323,11 +323,30 @@ describe('jqLite', function(){ }); }); describe('parent', function(){ + it('should return parent or an empty set when no parent', function(){ + var parent = jqLite('
abc
foo
'); + + fragment.appendChild(child[0]); + expect(child[0].parentNode).toBe(fragment); + expect(child.parent().length).toBe(0); + }); }); describe('next', function(){ it('should return next sibling', function(){ -- cgit v1.2.3