Skip to content

Commit 0a794ed

Browse files
committed
test runner: added 2 tests for [5500]
1 parent 6a9b73c commit 0a794ed

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

test/unit/core.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,16 +300,23 @@ test("each(Function)", function() {
300300
});
301301

302302
test("index(Object)", function() {
303-
expect(8);
304-
equals( $([window, document]).index(window), 0, "Check for index of elements" );
305-
equals( $([window, document]).index(document), 1, "Check for index of elements" );
306-
var inputElements = $('#radio1,#radio2,#check1,#check2');
303+
expect(10);
304+
305+
var elements = $([window, document]),
306+
inputElements = $('#radio1,#radio2,#check1,#check2');
307+
308+
equals( elements.index(window), 0, "Check for index of elements" );
309+
equals( elements.index(document), 1, "Check for index of elements" );
307310
equals( inputElements.index(document.getElementById('radio1')), 0, "Check for index of elements" );
308311
equals( inputElements.index(document.getElementById('radio2')), 1, "Check for index of elements" );
309312
equals( inputElements.index(document.getElementById('check1')), 2, "Check for index of elements" );
310313
equals( inputElements.index(document.getElementById('check2')), 3, "Check for index of elements" );
311314
equals( inputElements.index(window), -1, "Check for not found index" );
312315
equals( inputElements.index(document), -1, "Check for not found index" );
316+
317+
// enabled since [5500]
318+
equals( elements.index( elements ), 0, "Pass in a jQuery object" );
319+
equals( elements.index( elements.eq(1) ), 1, "Pass in a jQuery object" );
313320
});
314321

315322
test("attr(String)", function() {

0 commit comments

Comments
 (0)