Skip to content

Commit b0901e8

Browse files
committed
Added tests for ConductorAxisController and TimeConductor
1 parent dfed0a0 commit b0901e8

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

platform/features/conductor-v2/conductor/src/ui/ConductorAxisControllerSpec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ define([
2929
$,
3030
d3
3131
) {
32-
ddescribe("The ConductorAxisController", function () {
32+
describe("The ConductorAxisController", function () {
3333
var directive,
3434
mockConductor,
3535
mockConductorViewService,

src/api/TimeConductorSpec.js

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,19 @@ define(['./TimeConductor'], function (TimeConductor) {
5252
bounds = {start: 0, end: 1};
5353
expect(tc.bounds()).not.toBe(bounds);
5454
expect(tc.bounds.bind(tc, bounds)).not.toThrow();
55-
expect(tc.bounds()).toBe(bounds);
55+
expect(tc.bounds()).toEqual(bounds);
5656
});
5757

5858
it("Disallows setting of invalid bounds", function () {
5959
bounds = {start: 1, end: 0};
60-
expect(tc.bounds()).not.toBe(bounds);
60+
expect(tc.bounds()).not.toEqual(bounds);
6161
expect(tc.bounds.bind(tc, bounds)).toThrow();
62-
expect(tc.bounds()).not.toBe(bounds);
62+
expect(tc.bounds()).not.toEqual(bounds);
6363

6464
bounds = {start: 1};
65-
expect(tc.bounds()).not.toBe(bounds);
65+
expect(tc.bounds()).not.toEqual(bounds);
6666
expect(tc.bounds.bind(tc, bounds)).toThrow();
67-
expect(tc.bounds()).not.toBe(bounds);
67+
expect(tc.bounds()).not.toEqual(bounds);
6868
});
6969

7070
it("Allows setting of time system with bounds", function () {
@@ -106,5 +106,17 @@ define(['./TimeConductor'], function (TimeConductor) {
106106
tc.follow(follow);
107107
expect(eventListener).toHaveBeenCalledWith(follow);
108108
});
109+
110+
it("If bounds are set and TOI lies inside them, do not change TOI", function () {
111+
tc.timeOfInterest(6);
112+
tc.bounds({start: 1, end: 10});
113+
expect(tc.timeOfInterest()).toEqual(6);
114+
});
115+
116+
it("If bounds are set and TOI lies outside them, reset TOI", function () {
117+
tc.timeOfInterest(11);
118+
tc.bounds({start: 1, end: 10});
119+
expect(tc.timeOfInterest()).toBeUndefined();
120+
});
109121
});
110122
});

0 commit comments

Comments
 (0)