Ensure all elements are removed from 10006 test block

This commit is contained in:
Rick Waldron 2011-11-21 20:33:06 -05:00 committed by Dave Methvin
parent dff11c0392
commit ca08d93b72

View File

@ -197,26 +197,32 @@ test( "show() resolves correct default display, detached nodes (#10006)", functi
div = jQuery("<div class='hidden'>"); div = jQuery("<div class='hidden'>");
div.show().appendTo("#qunit-fixture"); div.show().appendTo("#qunit-fixture");
equal( div.css("display"), "block", "Make sure a detached, pre-hidden( through stylesheets ) div is visible." ); equal( div.css("display"), "block", "Make sure a detached, pre-hidden( through stylesheets ) div is visible." );
div.remove();
div = jQuery("<div style='display: none'>"); div = jQuery("<div style='display: none'>");
div.show().appendTo("#qunit-fixture"); div.show().appendTo("#qunit-fixture");
equal( div.css("display"), "block", "Make sure a detached, pre-hidden( through inline style ) div is visible." ); equal( div.css("display"), "block", "Make sure a detached, pre-hidden( through inline style ) div is visible." );
div.remove();
span = jQuery("<span class='hidden'/>"); span = jQuery("<span class='hidden'/>");
span.show().appendTo("#qunit-fixture"); span.show().appendTo("#qunit-fixture");
equal( span.css("display"), "inline", "Make sure a detached, pre-hidden( through stylesheets ) span has default display." ); equal( span.css("display"), "inline", "Make sure a detached, pre-hidden( through stylesheets ) span has default display." );
span.remove();
span = jQuery("<span style='display: inline'/>"); span = jQuery("<span style='display: inline'/>");
span.show().appendTo("#qunit-fixture"); span.show().appendTo("#qunit-fixture");
equal( span.css("display"), "inline", "Make sure a detached, pre-hidden( through inline style ) span has default display." ); equal( span.css("display"), "inline", "Make sure a detached, pre-hidden( through inline style ) span has default display." );
span.remove();
div = jQuery("<div><div class='hidden'></div></div>").children("div"); div = jQuery("<div><div class='hidden'></div></div>").children("div");
div.show().appendTo("#qunit-fixture"); div.show().appendTo("#qunit-fixture");
equal( div.css("display"), "block", "Make sure a detached, pre-hidden( through stylesheets ) div inside another visible div is visible." ); equal( div.css("display"), "block", "Make sure a detached, pre-hidden( through stylesheets ) div inside another visible div is visible." );
div.remove();
div = jQuery("<div><div style='display: none'></div></div>").children("div"); div = jQuery("<div><div style='display: none'></div></div>").children("div");
div.show().appendTo("#qunit-fixture"); div.show().appendTo("#qunit-fixture");
equal( div.css("display"), "block", "Make sure a detached, pre-hidden( through inline style ) div inside another visible div is visible." ); equal( div.css("display"), "block", "Make sure a detached, pre-hidden( through inline style ) div inside another visible div is visible." );
div.remove();
div = jQuery("div.hidden"); div = jQuery("div.hidden");
div.detach().show(); div.detach().show();
@ -231,14 +237,17 @@ test( "show() resolves correct default display, detached nodes (#10006)", functi
div = jQuery("<div>"); div = jQuery("<div>");
div.show().appendTo("#qunit-fixture"); div.show().appendTo("#qunit-fixture");
ok( !!div.get( 0 ).style.display, "Make sure not hidden div has a inline style." ); ok( !!div.get( 0 ).style.display, "Make sure not hidden div has a inline style." );
div.remove();
div = jQuery( document.createElement("div") ); div = jQuery( document.createElement("div") );
div.show().appendTo("#qunit-fixture"); div.show().appendTo("#qunit-fixture");
equal( div.css("display"), "block", "Make sure a pre-created element has default display." ); equal( div.css("display"), "block", "Make sure a pre-created element has default display." );
div.remove();
div = jQuery("<div style='display: inline'/>"); div = jQuery("<div style='display: inline'/>");
div.show().appendTo("#qunit-fixture"); div.show().appendTo("#qunit-fixture");
equal( div.css("display"), "inline", "Make sure that element has same display when it was created." ); equal( div.css("display"), "inline", "Make sure that element has same display when it was created." );
div.remove();
}); });