I think the dom.isInDOM function would also be very useful in the unit tests.