Haacked/jquery.undoable — pull request #4 by Beanalby (2013-02-14 20:42:48+00:00)
Title: unit tests

My stab at QUnit tests for the previous pull & a few other that were missing. I'm not familiar with the framework and guessed at some precedents, feel free to butcher as desired.

--------------------
WRT the existing test failing in Chrome/FF: this seems to be Chrome not changing .prop when .attr is set in A tags, e.g.
$("").attr("disabled", "disabled").prop("disabled")==undefined
even though
$("").attr("disabled", "disabled").prop("disabled")==true

My understanding is "disabled in" >1.6 should be .prop rather than .attr & .removeAttr, but that'd be changing both the lib and the unit test and I wasn't confident enough about it to rock the boat that much.

The test could also be fixed by changing the first part to check .attr("disabled") is either false (IE) or undefined (Chrome) and in the 2nd part only testing .attr("disabled") instead of both that & .prop("disabled"). I could throw together either the .prop change or the test fix if you'd like.