module("attributes", { teardown: moduleTeardown }); var bareObj = function(value) { return value; }; var functionReturningObj = function(value) { return (function() { return value; }); }; test("jQuery.attrFix integrity test", function() { expect(1); // This must be maintained and equal jQuery.attrFix when appropriate // Ensure that accidental or erroneous property // overwrites don't occur // This is simply for better code coverage and future proofing. var propsShouldBe; if ( !jQuery.support.getSetAttribute ) { propsShouldBe = { tabindex: "tabIndex", readonly: "readOnly", "for": "htmlFor", "class": "className", maxlength: "maxLength", cellspacing: "cellSpacing", cellpadding: "cellPadding", rowspan: "rowSpan", colspan: "colSpan", usemap: "useMap", frameborder: "frameBorder" }; } else { propsShouldBe = { tabindex: "tabIndex", readonly: "readOnly" }; } same(propsShouldBe, jQuery.attrFix, "jQuery.attrFix passes integrity check"); }); test("prop(String, Object)", function() { expect(19); equals( jQuery("#text1").prop("value"), "Test", "Check for value attribute" ); equals( jQuery("#text1").prop("value", "Test2").prop("defaultValue"), "Test", "Check for defaultValue attribute" ); equals( jQuery("#select2").prop("selectedIndex"), 3, "Check for selectedIndex attribute" ); equals( jQuery("#foo").prop("nodeName").toUpperCase(), "DIV", "Check for nodeName attribute" ); equals( jQuery("#foo").prop("tagName").toUpperCase(), "DIV", "Check for tagName attribute" ); equals( jQuery("