mirror of
https://github.com/nasa/openmct.git
synced 2025-06-07 09:51:41 +00:00
[Timeline] Update zoom controller spec
...to reflect changes/simplifications for #936.
This commit is contained in:
parent
99590d18f7
commit
23b64951f3
@ -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 () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user