From a25343001eea2436dcf8ea60deea3844f77e42e4 Mon Sep 17 00:00:00 2001 From: Oleg Date: Tue, 17 Sep 2013 15:47:31 +0400 Subject: Fix #12723 and simplification and optmization of defaultDisplay helper --- test/unit/css.js | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'test') diff --git a/test/unit/css.js b/test/unit/css.js index 3a106c04d..460e5d60b 100644 --- a/test/unit/css.js +++ b/test/unit/css.js @@ -543,21 +543,25 @@ test( "show() resolves correct default display for detached nodes", function(){ span.remove(); }); -test("show() resolves correct default display #10227", function() { - expect(2); +test("show() resolves correct default display #10227", 4, function() { + var html = jQuery( document.documentElement ), + body = jQuery( "body" ); - var body = jQuery("body"); - body.append( - "

a

" - ); + body.append( "

a

" ); - equal( body.css("display"), "none", "Initial display: none" ); + equal( body.css("display"), "none", "Initial display for body element: none" ); body.show(); - equal( body.css("display"), "block", "Correct display: block" ); + equal( body.css("display"), "block", "Correct display for body element: block" ); + + body.append( "

a

" ); + + equal( html.css("display"), "none", "Initial display for html element: none" ); + + html.show(); + equal( html.css( "display" ), "block", "Correct display for html element: block" ); - jQuery("#ddisplay").remove(); - QUnit.expectJqData( body[0], "olddisplay" ); + jQuery( ".ddisplay" ).remove(); }); test("show() resolves correct default display when iframe display:none #12904", function() { -- cgit v1.2.3