From 0a794ed5fc651dbcce7eb9ff780656ea31c996d5 Mon Sep 17 00:00:00 2001 From: Ariel Flesler Date: Thu, 8 May 2008 17:16:49 +0000 Subject: [PATCH] test runner: added 2 tests for [5500] --- test/unit/core.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/test/unit/core.js b/test/unit/core.js index d4cc165..fccf8e4 100644 --- a/test/unit/core.js +++ b/test/unit/core.js @@ -300,16 +300,23 @@ test("each(Function)", function() { }); test("index(Object)", function() { - expect(8); - equals( $([window, document]).index(window), 0, "Check for index of elements" ); - equals( $([window, document]).index(document), 1, "Check for index of elements" ); - var inputElements = $('#radio1,#radio2,#check1,#check2'); + expect(10); + + var elements = $([window, document]), + inputElements = $('#radio1,#radio2,#check1,#check2'); + + equals( elements.index(window), 0, "Check for index of elements" ); + equals( elements.index(document), 1, "Check for index of elements" ); equals( inputElements.index(document.getElementById('radio1')), 0, "Check for index of elements" ); equals( inputElements.index(document.getElementById('radio2')), 1, "Check for index of elements" ); equals( inputElements.index(document.getElementById('check1')), 2, "Check for index of elements" ); equals( inputElements.index(document.getElementById('check2')), 3, "Check for index of elements" ); equals( inputElements.index(window), -1, "Check for not found index" ); equals( inputElements.index(document), -1, "Check for not found index" ); + + // enabled since [5500] + equals( elements.index( elements ), 0, "Pass in a jQuery object" ); + equals( elements.index( elements.eq(1) ), 1, "Pass in a jQuery object" ); }); test("attr(String)", function() { -- 1.7.10.4