verify that eval isn't called after destroy

This commit is contained in:
Pete Richards 2017-07-05 16:48:09 -07:00
parent d82230dea4
commit 89515bb896

View File

@ -102,11 +102,16 @@ define(
// Broadcast a destroy event // Broadcast a destroy event
mockScope.$on.mostRecentCall.args[1](); mockScope.$on.mostRecentCall.args[1]();
testElement.offsetWidth = 300;
testElement.offsetHeight = 350;
mockScope.$eval.reset();
// Fire the timeout // Fire the timeout
mockTimeout.mostRecentCall.args[0](); mockTimeout.mostRecentCall.args[0]();
// Should NOT have scheduled another timeout // Should NOT have scheduled another timeout
expect(mockTimeout.calls.length).toEqual(2); expect(mockTimeout.calls.length).toEqual(2);
expect(mockScope.$eval).not.toHaveBeenCalled();
}); });
it("triggers a digest cycle when size changes", function () { it("triggers a digest cycle when size changes", function () {