Commit cbd51c50 authored by Timmy Willison's avatar Timmy Willison

Tests: fix tests in accordance with new :visible behavior

parent dd816dba
...@@ -982,9 +982,9 @@ test( "css opacity consistency across browsers (#12685)", function() { ...@@ -982,9 +982,9 @@ test( "css opacity consistency across browsers (#12685)", function() {
}); });
test( ":visible/:hidden selectors", function() { test( ":visible/:hidden selectors", function() {
expect( 18 ); expect( 17 );
var $div, $br, $table, $a; var $div, $table, $a;
ok( jQuery("#nothiddendiv").is(":visible"), "Modifying CSS display: Assert element is visible" ); ok( jQuery("#nothiddendiv").is(":visible"), "Modifying CSS display: Assert element is visible" );
jQuery("#nothiddendiv").css({ display: "none" }); jQuery("#nothiddendiv").css({ display: "none" });
...@@ -1006,8 +1006,10 @@ test( ":visible/:hidden selectors", function() { ...@@ -1006,8 +1006,10 @@ test( ":visible/:hidden selectors", function() {
$div.css( { width: 0, height: 0, overflow: "hidden" } ); $div.css( { width: 0, height: 0, overflow: "hidden" } );
ok( $div.is( ":visible" ), "Div with width and height of 0 is still visible (gh-2227)" ); ok( $div.is( ":visible" ), "Div with width and height of 0 is still visible (gh-2227)" );
$br = jQuery( "<br/>" ).appendTo( "#qunit-fixture" ); // Safari 6-7 and iOS 6-7 report 0 width for br elements
ok( $br.is( ":visible" ), "br element is visible" ); // When newer browsers propagate, re-enable this test
// $br = jQuery( "<br/>" ).appendTo( "#qunit-fixture" );
// ok( $br.is( ":visible" ), "br element is visible" );
$table = jQuery("#table"); $table = jQuery("#table");
$table.html("<tr><td style='display:none'>cell</td><td>cell</td></tr>"); $table.html("<tr><td style='display:none'>cell</td><td>cell</td></tr>");
......
...@@ -25,7 +25,7 @@ module("effects", { ...@@ -25,7 +25,7 @@ module("effects", {
test("sanity check", function() { test("sanity check", function() {
expect(1); expect(1);
equal( jQuery("#dl:visible, #qunit-fixture:visible, #foo:visible").length, 2, "QUnit state is correct for testing effects" ); equal( jQuery("#dl:visible, #qunit-fixture:visible, #foo:visible").length, 3, "QUnit state is correct for testing effects" );
}); });
test("show() basic", 1, function() { test("show() basic", 1, function() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment