mirror of
https://github.com/jquery/jquery.git
synced 2026-02-04 06:45:17 -05:00
Return correct index for no-arg index() calls. Fixes #10977. Closes gh-971
This commit is contained in:
@@ -651,3 +651,12 @@ test("eq('-1') #10616", function() {
|
||||
equal( $divs.eq( "-1" ).length, 1, "The string '-1' returns a selection that has length 1" );
|
||||
deepEqual( $divs.eq( "-1" ), $divs.eq( -1 ), "String and number -1 match" );
|
||||
});
|
||||
|
||||
test("index(no arg) #10977", function() {
|
||||
expect(1);
|
||||
|
||||
var $list = jQuery("<ul id='indextest'><li>THIS ONE</li><li class='one'>a</li><li class='two'>b</li><li class='three'>c</li></ul>");
|
||||
jQuery("#qunit-fixture").append( $list );
|
||||
strictEqual ( jQuery( "#indextest li:not(.one,.two)" ).index() , 0, "No Argument Index Check" );
|
||||
$list.remove();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user