Dialog windows open conditionally

It is the work of [Sinon.JS for QUnit](http://sinonjs.org/qunit/).

@winhamwr we get automatic unwrapping of spies after each test.

Thank you for commenting on that because now the code is cleaner.