[Timeline] Update zoom controller spec

...to reflect changes/simplifications for #936.
This commit is contained in:
Victor Woeltjen 2016-06-02 16:42:09 -07:00
parent 99590d18f7
commit 23b64951f3

View File

@ -38,6 +38,7 @@ define(
}; };
mockScope = jasmine.createSpyObj("$scope", ['$watch']); mockScope = jasmine.createSpyObj("$scope", ['$watch']);
mockScope.commit = jasmine.createSpy('commit'); mockScope.commit = jasmine.createSpy('commit');
mockScope.scroll = { x: 0, width: 1000 };
mockTimeout = jasmine.createSpy('$timeout'); mockTimeout = jasmine.createSpy('$timeout');
controller = new TimelineZoomController( controller = new TimelineZoomController(
mockScope, mockScope,
@ -67,11 +68,6 @@ define(
expect(controller.zoom()).toEqual(3500); expect(controller.zoom()).toEqual(3500);
}); });
it("observes scroll bounds", function () {
expect(mockScope.$watch)
.toHaveBeenCalledWith("scroll", jasmine.any(Function));
});
describe("when watches have fired", function () { describe("when watches have fired", function () {
var mockDomainObject, var mockDomainObject,
mockPromise, mockPromise,
@ -112,6 +108,10 @@ define(
mockScope.$watch.calls.forEach(function (call) { mockScope.$watch.calls.forEach(function (call) {
call.args[1](mockScope[call.args[0]]); call.args[1](mockScope[call.args[0]]);
}); });
mockTimeout.calls.forEach(function (call) {
call.args[0]();
});
}); });
it("zooms to fit the timeline", function () { it("zooms to fit the timeline", function () {