Skip to content

Commit

Permalink
Fix some unscoped tests which failed after recent changes to QUnit.
Browse files Browse the repository at this point in the history
  • Loading branch information
jitter committed Feb 15, 2011
1 parent 2cc03a8 commit 8e40a84
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions test/unit/core.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -537,29 +537,29 @@ test("end()", function() {


test("length", function() { test("length", function() {
expect(1); expect(1);
equals( jQuery("p").length, 6, "Get Number of Elements Found" ); equals( jQuery("#main p").length, 6, "Get Number of Elements Found" );
}); });


test("size()", function() { test("size()", function() {
expect(1); expect(1);
equals( jQuery("p").size(), 6, "Get Number of Elements Found" ); equals( jQuery("#main p").size(), 6, "Get Number of Elements Found" );
}); });


test("get()", function() { test("get()", function() {
expect(1); expect(1);
same( jQuery("p").get(), q("firstp","ap","sndp","en","sap","first"), "Get All Elements" ); same( jQuery("#main p").get(), q("firstp","ap","sndp","en","sap","first"), "Get All Elements" );
}); });


test("toArray()", function() { test("toArray()", function() {
expect(1); expect(1);
same( jQuery("p").toArray(), same( jQuery("#main p").toArray(),
q("firstp","ap","sndp","en","sap","first"), q("firstp","ap","sndp","en","sap","first"),
"Convert jQuery object to an Array" ); "Convert jQuery object to an Array" );
}); });


test("get(Number)", function() { test("get(Number)", function() {
expect(2); expect(2);
equals( jQuery("p").get(0), document.getElementById("firstp"), "Get A Single Element" ); equals( jQuery("#main p").get(0), document.getElementById("firstp"), "Get A Single Element" );
strictEqual( jQuery("#firstp").get(1), undefined, "Try get with index larger elements count" ); strictEqual( jQuery("#firstp").get(1), undefined, "Try get with index larger elements count" );
}); });


Expand Down
2 changes: 1 addition & 1 deletion test/unit/event.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ test("bind(), namespaced events, cloned events", 18, function() {
}).trigger("tester"); }).trigger("tester");


// Make sure events stick with appendTo'd elements (which are cloned) #2027 // Make sure events stick with appendTo'd elements (which are cloned) #2027
jQuery("<a href='#fail' class='test'>test</a>").click(function(){ return false; }).appendTo("p"); jQuery("<a href='#fail' class='test'>test</a>").click(function(){ return false; }).appendTo("#main");
ok( jQuery("a.test:first").triggerHandler("click") === false, "Handler is bound to appendTo'd elements" ); ok( jQuery("a.test:first").triggerHandler("click") === false, "Handler is bound to appendTo'd elements" );
}); });


Expand Down
6 changes: 3 additions & 3 deletions test/unit/traversing.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ test("filter(Selector)", function() {
test("filter(Function)", function() { test("filter(Function)", function() {
expect(2); expect(2);


same( jQuery("p").filter(function() { return !jQuery("a", this).length }).get(), q("sndp", "first"), "filter(Function)" ); same( jQuery("#main p").filter(function() { return !jQuery("a", this).length }).get(), q("sndp", "first"), "filter(Function)" );


same( jQuery("p").filter(function(i, elem) { return !jQuery("a", elem).length }).get(), q("sndp", "first"), "filter(Function) using arg" ); same( jQuery("#main p").filter(function(i, elem) { return !jQuery("a", elem).length }).get(), q("sndp", "first"), "filter(Function) using arg" );
}); });


test("filter(Element)", function() { test("filter(Element)", function() {
Expand Down Expand Up @@ -178,7 +178,7 @@ test("not(Element)", function() {
}); });


test("not(Function)", function() { test("not(Function)", function() {
same( jQuery("p").not(function() { return jQuery("a", this).length }).get(), q("sndp", "first"), "not(Function)" ); same( jQuery("#main p").not(function() { return jQuery("a", this).length }).get(), q("sndp", "first"), "not(Function)" );
}); });


test("not(Array)", function() { test("not(Array)", function() {
Expand Down

0 comments on commit 8e40a84

Please sign in to comment.