X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fattributes.js;h=8cf47bed6635b870ba0dd80b88149de82fca752f;hb=714ae379db9dcb704c04080196a05d13a028f7a4;hp=04f168466dd8af6c1720bfc4e6e764c8b146f4d1;hpb=8e59a99e0ade75dec434f246f52e8b3f7393f359;p=jquery.git diff --git a/test/unit/attributes.js b/test/unit/attributes.js index 04f1684..8cf47be 100644 --- a/test/unit/attributes.js +++ b/test/unit/attributes.js @@ -1,4 +1,4 @@ -module("attributes"); +module("attributes", { teardown: moduleTeardown }); var bareObj = function(value) { return value; }; var functionReturningObj = function(value) { return (function() { return value; }); }; @@ -546,6 +546,25 @@ test("val(Function) with incoming value", function() { equals( jQuery("#select1").val(), "4", "Should be possible to set the val() to a newly created option" ); }); +// testing if a form.reset() breaks a subsequent call to a select element's .val() (in IE only) +test("val(select) after form.reset() (Bug #2551)", function() { + expect(3); + + jQuery('
').appendTo("#main"); + + jQuery("#kkk").val( "gf" ); + + document.kk.reset(); + + equal( jQuery("#kkk")[0].value, "cf", "Check value of select after form reset." ); + equal( jQuery("#kkk").val(), "cf", "Check value of select after form reset." ); + + // re-verify the multi-select is not broken (after form.reset) by our fix for single-select + same( jQuery('#select3').val(), ['1', '2'], 'Call val() on a multiple="multiple" select' ); + + jQuery("#kk").remove(); +}); + var testAddClass = function(valueObj) { expect(5); var div = jQuery("div");