X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=test%2Funit%2Fcore.js;h=f3a3aa3dba9610c5a93865c44b06802c4325215a;hb=f576ceeea9eea5fec6b31172765df4da8b264ac8;hp=a1ebb1ba428d111a38e93a5e7576c98f7d4c00ea;hpb=37902e86b158eaa90f44d0932063d22df3050326;p=jquery.git diff --git a/test/unit/core.js b/test/unit/core.js index a1ebb1b..f3a3aa3 100644 --- a/test/unit/core.js +++ b/test/unit/core.js @@ -12,14 +12,19 @@ test("Basic requirements", function() { }); test("$()", function() { - expect(5); + expect(4); var main = $("#main"); isSet( $("div p", main).get(), q("sndp", "en", "sap"), "Basic selector with jQuery object as context" ); +/* + // disabled since this test was doing nothing. i tried to fix it but i'm not sure + // what the expected behavior should even be. FF returns "\n" for the text node // make sure this is handled - $('

\r\n

'); - ok( true, "Check for \\r and \\n in jQuery()" ); + var crlfContainer = $('

\r\n

'); + var x = crlfContainer.contents().get(0).nodeValue; + equals( x, what???, "Check for \\r and \\n in jQuery()" ); +*/ /* // Disabled until we add this functionality in var pass = true; @@ -148,7 +153,7 @@ var foo = false; test("$('html')", function() { expect(4); - + reset(); foo = false; var s = $("")[0]; @@ -163,6 +168,14 @@ test("$('html')", function() { reset(); }); +test("$('html', context)", function() { + expect(1); + + var $div = $("
"); + var $span = $("", $div); + equals($span.length, 1, "Verify a span created with a div context works"); +}); + test("length", function() { expect(1); ok( $("p").length == 6, "Get Number of Elements Found" ); @@ -380,7 +393,7 @@ test("css(String|Hash)", function() { }); test("css(String, Object)", function() { - expect(18); + expect(19); ok( $('#foo').is(':visible'), 'Modifying CSS display: Assert element is visible'); $('#foo').css('display', 'none'); ok( !$('#foo').is(':visible'), 'Modified CSS display: Assert element is hidden'); @@ -404,6 +417,11 @@ test("css(String, Object)", function() { }); $('#foo').css('opacity', ''); ok( $('#foo').css('opacity') == '1', "Assert opacity is 1 when set to an empty String" ); + // for #1438, IE throws JS error when filter exists but doesn't have opacity in it + if (jQuery.browser.msie) { + $('#foo').css("filter", "progid:DXImageTransform.Microsoft.Chroma(color='red');"); + } + equals( $('#foo').css('opacity'), '1', "Assert opacity is 1 when a different filter is set in IE, #1438" ); }); test("jQuery.css(elem, 'height') doesn't clear radio buttons (bug #1095)", function () {