X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Feffects.js;h=b7b60abbe495b8539d23c7b78ffcf88a13efec7c;hb=5bacb53866dbc3fbb36202a25c756a4ea2fd5965;hp=74b336f1f9aea35eae4650e8cc647ad4ff4b5d87;hpb=3e38a861fee065fa1a6e7678eefe90b2379fed8e;p=jquery.git
diff --git a/test/unit/effects.js b/test/unit/effects.js
index 74b336f..b7b60ab 100644
--- a/test/unit/effects.js
+++ b/test/unit/effects.js
@@ -64,7 +64,7 @@ test("show()", function() {
// #show-tests * is set display: none in CSS
jQuery("#main").append('
');
-
+
var old = jQuery("#test-table").show().css("display") !== "table";
jQuery("#test-table").remove();
@@ -130,6 +130,45 @@ test("show(Number) - other displays", function() {
});
});
+
+
+// Supports #7397
+test("Persist correct display value", function() {
+ expect(3);
+ QUnit.reset();
+ stop();
+
+ // #show-tests * is set display: none in CSS
+ jQuery("#main").append('foo
');
+
+ var $span = jQuery("#show-tests span"),
+ displayNone = $span.css("display"),
+ display = '', num = 0;
+
+ $span.show();
+
+ display = $span.css("display");
+
+ $span.hide();
+
+ $span.fadeIn(100, function() {
+
+ equals($span.css("display"), display, "Expecting display: " + display);
+
+ $span.fadeOut(100, function () {
+
+ equals($span.css("display"), displayNone, "Expecting display: " + displayNone);
+
+ $span.fadeIn(100, function() {
+
+ equals($span.css("display"), display, "Expecting display: " + display);
+
+ start();
+ });
+ });
+ });
+});
+
test("animate(Hash, Object, Function)", function() {
expect(1);
stop();
@@ -155,7 +194,7 @@ test("animate block as inline width/height", function() {
var span = jQuery("").css("display", "inline-block").appendTo("body"),
expected = span.css("display");
-
+
span.remove();
if ( jQuery.support.inlineBlockNeedsLayout || expected === "inline-block" ) {
@@ -181,7 +220,7 @@ test("animate native inline width/height", function() {
var span = jQuery("").css("display", "inline-block").appendTo("body"),
expected = span.css("display");
-
+
span.remove();
if ( jQuery.support.inlineBlockNeedsLayout || expected === "inline-block" ) {
@@ -521,6 +560,23 @@ jQuery.checkOverflowDisplay = function(){
start();
}
+test("support negative values < -10000 (bug #7193)", function () {
+ expect(1);
+ stop();
+
+ jQuery.extend(jQuery.fx.step, {
+ "marginBottom": function(fx) {
+ equals( fx.cur(), -11000, "Element has margin-bottom of -11000" );
+ delete jQuery.fx.step.marginBottom;
+ }
+ });
+
+ jQuery("#main").css("marginBottom", "-11000px").animate({ marginBottom: "-11001px" }, {
+ duration: 1,
+ complete: start
+ });
+});
+
test("JS Overflow and Display", function() {
expect(2);
stop();
@@ -850,7 +906,7 @@ test("hide hidden elements, with animation (bug #7141)", function() {
expect(3);
QUnit.reset();
stop();
-
+
var div = jQuery("").appendTo("#main");
equals( div.css("display"), "none", "Element is hidden by default" );
div.hide(1, function () {