aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/unit/core.js15
1 files changed, 11 insertions, 4 deletions
diff --git a/test/unit/core.js b/test/unit/core.js
index d4cc165c5..fccf8e459 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() {