make destroy reflow test more strict

validate that the listener is not being properly removed
This commit is contained in:
Joe Fleming 2015-05-26 15:52:57 -07:00
parent 42f404a8a9
commit 8e881e5f14

View file

@ -156,9 +156,12 @@ define(function (require) {
describe('#destroy()', function () {
it('removes the "reflow" event from the reflowWatcher', function () {
var onCall = reflowSpies.on.getCall(0);
var handler = onCall.args[1];
checker.destroy();
expect(reflowSpies.off).to.have.property('callCount', 1);
expect(reflowSpies.off.calledWith('reflow')).to.be.ok();
expect(reflowSpies.off.calledWith('reflow', handler)).to.be.ok();
});
it('clears the timeout', function () {