X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fjquery%2FcoreTest.js;h=5c982ee225b56eb6edb30c58d9d9686b8f785ca4;hb=0f7c89cd97de6ca644a834a119dda1e057fd724e;hp=4370e9da82391c08b696eab9a66cf3354180b406;hpb=3728a8ac0494de7ccab48bfc69f5d71496ba64c2;p=jquery.git diff --git a/src/jquery/coreTest.js b/src/jquery/coreTest.js index 4370e9d..5c982ee 100644 --- a/src/jquery/coreTest.js +++ b/src/jquery/coreTest.js @@ -261,9 +261,9 @@ test("css(String|Hash)", function() { $.each("0,0.25,0.5,0.75,1".split(','), function(i, n) { $('#foo').css({opacity: n}); - ok( $('#foo').css('opacity') == n, "Assert opacity is " + n + " as a String" ); + ok( $('#foo').css('opacity') == parseFloat(n), "Assert opacity is " + parseFloat(n) + " as a String" ); $('#foo').css({opacity: parseFloat(n)}); - ok( $('#foo').css('opacity') == n, "Assert opacity is " + n + " as a Number" ); + ok( $('#foo').css('opacity') == parseFloat(n), "Assert opacity is " + parseFloat(n) + " as a Number" ); }); $('#foo').css({opacity: ''}); ok( $('#foo').css('opacity') == '1', "Assert opacity is 1 when set to an empty String" ); @@ -288,9 +288,9 @@ test("css(String, Object)", function() { $.each("0,0.25,0.5,0.75,1".split(','), function(i, n) { $('#foo').css('opacity', n); - ok( $('#foo').css('opacity') == n, "Assert opacity is " + n + " as a String" ); + ok( $('#foo').css('opacity') == parseFloat(n), "Assert opacity is " + parseFloat(n) + " as a String" ); $('#foo').css('opacity', parseFloat(n)); - ok( $('#foo').css('opacity') == n, "Assert opacity is " + n + " as a Number" ); + ok( $('#foo').css('opacity') == parseFloat(n), "Assert opacity is " + parseFloat(n) + " as a Number" ); }); $('#foo').css('opacity', ''); ok( $('#foo').css('opacity') == '1', "Assert opacity is 1 when set to an empty String" ); @@ -316,7 +316,7 @@ test("wrap(String|Element)", function() { }); test("append(String|Element|Array<Element>|jQuery)", function() { - expect(11); + expect(12); var defaultText = 'Try them out:' var result = $('#first').append('buga'); ok( result.text() == defaultText + 'buga', 'Check if text appending works' ); @@ -353,6 +353,16 @@ test("append(String|Element|Array<Element>|jQuery)", function() { reset(); $("#sap").append(document.getElementById('form')); ok( $("#sap>form").size() == 1, "Check for appending a form" ); // Bug #910 + + reset(); + var pass = true; + try { + $( $("iframe")[0].contentWindow.document.body ).append("
test
"); + } catch(e) { + pass = false; + } + + ok( pass, "Test for appending a DOM node to the contents of an IFrame" ); });