The introduction to QUnit over at netTuts.com spawns an interesting exchange (never resolved) over how to apply unit tests against actions that manipulate the DOM. The following
The latest version of QUnit supports a #qunit-fixture
element that lets you add HTML to the QUnit web page.
E.g., in your HTML:
test markup, will be hidden
and in your JavaScript:
$('').appendTo('#qunit-fixture');
var result = add(a, b);
equals(result, $('input#ResultTestBox').val(), "testing result box value");