Added test for filter(Array), fixed bug #446
This commit is contained in:
parent
fea94528e2
commit
3ab145e5aa
8
src/jquery/coreTest.js
vendored
8
src/jquery/coreTest.js
vendored
|
@ -258,8 +258,9 @@ test("clone()", function() {
|
||||||
ok( 'This is a normal link: Yahoo' == $('#en').text(), 'Reassert text for #en' );
|
ok( 'This is a normal link: Yahoo' == $('#en').text(), 'Reassert text for #en' );
|
||||||
});
|
});
|
||||||
|
|
||||||
test("filter(String)", function() {
|
test("filter()", function() {
|
||||||
isSet( $("input").filter(":checked").get(), q("radio2", "check1"), "Filter elements" );
|
isSet( $("input").filter(":checked").get(), q("radio2", "check1"), "filter(String)" );
|
||||||
|
isSet( $("p").filter(["#ap", "#sndp"]).get(), q("ap", "sndp"), "filter(Array<String>)" );
|
||||||
});
|
});
|
||||||
|
|
||||||
test("filter(String) - execute callback in fitting context", function() {
|
test("filter(String) - execute callback in fitting context", function() {
|
||||||
|
@ -277,7 +278,8 @@ test("filter(String) - execute callback in not-fitting context", function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
test("not(String)", function() {
|
test("not(String)", function() {
|
||||||
ok($("#main > p#ap > a").not("#google").length == 2, ".not")
|
ok($("#main > p#ap > a").not("#google").length == 2, "not('selector')")
|
||||||
|
isSet( $("p").not("#ap, #sndp").get(), q("firstp", "en", "sap", "first", "result"), "not('selector, selector')" );
|
||||||
});
|
});
|
||||||
|
|
||||||
test("is(String)", function() {
|
test("is(String)", function() {
|
||||||
|
|
2
src/jquery/jquery.js
vendored
2
src/jquery/jquery.js
vendored
|
@ -863,7 +863,7 @@ jQuery.fn = jQuery.prototype = {
|
||||||
for ( var i = 0; i < t.length; i++ )
|
for ( var i = 0; i < t.length; i++ )
|
||||||
if ( jQuery.filter(t[i],[a]).r.length )
|
if ( jQuery.filter(t[i],[a]).r.length )
|
||||||
return a;
|
return a;
|
||||||
return false;
|
return null;
|
||||||
}) ||
|
}) ||
|
||||||
|
|
||||||
t.constructor == Boolean &&
|
t.constructor == Boolean &&
|
||||||
|
|
Loading…
Reference in a new issue