X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fcore.js;h=289a8bace0f9318d874607bd22bd813703d9c8ec;hb=e73990a566fcb2dac71e1a25ec83382645adc5b7;hp=9d91c4f754d040a71c0e8f80fe14cd59730c7fa4;hpb=a37ca9e9058243169725982e91bce60801b9857d;p=jquery.git diff --git a/test/unit/core.js b/test/unit/core.js index 9d91c4f..289a8ba 100644 --- a/test/unit/core.js +++ b/test/unit/core.js @@ -463,7 +463,7 @@ test("attr(Hash)", function() { }); test("attr(String, Object)", function() { - expect(19); + expect(21); var div = jQuery("div").attr("foo", "bar"), fail = false; for ( var i = 0; i < div.size(); i++ ) { @@ -537,6 +537,16 @@ test("attr(String, Object)", function() { } ok( thrown, "Exception thrown when trying to change type property" ); equals( "checkbox", check.attr('type'), "Verify that you can change the type of an input element that isn't in the DOM" ); + + var button = jQuery("#button"); + var thrown = false; + try { + button.attr('type','submit'); + } catch(e) { + thrown = true; + } + ok( thrown, "Exception thrown when trying to change type property" ); + equals( "button", button.attr('type'), "Verify that you can't change the type of a button element" ); }); if ( !isLocal ) { @@ -1688,13 +1698,6 @@ test("jQuery.each(Object,Function)", function() { equals( total, 3, "Looping over an object, with break" ); }); -test("jQuery.prop", function() { - expect(2); - var handle = function() { return this.id }; - equals( jQuery.prop(jQuery("#ap")[0], handle), "ap", "Check with Function argument" ); - equals( jQuery.prop(jQuery("#ap")[0], "value"), "value", "Check with value argument" ); -}); - test("jQuery.className", function() { expect(6); var x = jQuery("

Hi

")[0];