X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fdimensions.js;fp=test%2Funit%2Fdimensions.js;h=8653de42caf389530ee65af8c1b1046493b2e038;hb=a5f8a1441158b66efb76de1d15f061f87f7bdc17;hp=f365f928925615c500ce94c50113a6e60dbf0dbf;hpb=715d1c5a30cc4986018bbf063713f14c34c3e258;p=jquery.git diff --git a/test/unit/dimensions.js b/test/unit/dimensions.js index f365f92..8653de4 100644 --- a/test/unit/dimensions.js +++ b/test/unit/dimensions.js @@ -1,7 +1,7 @@ module("dimensions"); test("width()", function() { - expect(6); + expect(7); var $div = jQuery("#nothiddendiv"); $div.width(30); @@ -28,10 +28,13 @@ test("width()", function() { jQuery("#nothiddendivchild").css({ padding: "3px", border: "2px solid #fff" }); equals(jQuery("#nothiddendivchild").width(), 20, "Test child width with border and padding"); jQuery("#nothiddendiv, #nothiddendivchild").css({ border: "", padding: "", width: "" }); + + var blah = jQuery("blah"); + equals( blah.width(10), blah, "Make sure that setting a width on an empty set returns the set." ); }); test("height()", function() { - expect(5); + expect(6); var $div = jQuery("#nothiddendiv"); $div.height(30); @@ -54,6 +57,9 @@ test("height()", function() { //equals($div.height(), 30, "Test padding specified with percent"); $div.css({ display: "", border: "", padding: "", height: "1px" }); + + var blah = jQuery("blah"); + equals( blah.height(10), blah, "Make sure that setting a height on an empty set returns the set." ); }); test("innerWidth()", function() { @@ -139,4 +145,4 @@ test("outerHeight()", function() { // reset styles $div.css({ display: "", border: "", padding: "", width: "", height: "" }); -}); \ No newline at end of file +});