aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAriel Flesler <aflesler@gmail.com>2008-05-08 17:16:49 +0000
committerAriel Flesler <aflesler@gmail.com>2008-05-08 17:16:49 +0000
commit0a794ed5fc651dbcce7eb9ff780656ea31c996d5 (patch)
treea17918f1e5cef02522bbf22917eae207492b8fa2 /test
parent6a9b73c7b97b7a1dbb3febde80aef70ebe162cd2 (diff)
downloadjquery-0a794ed5fc651dbcce7eb9ff780656ea31c996d5.tar.gz
jquery-0a794ed5fc651dbcce7eb9ff780656ea31c996d5.zip
test runner: added 2 tests for [5500]
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() {