@@ -52,19 +52,19 @@ define(['./TimeConductor'], function (TimeConductor) {
52
52
bounds = { start : 0 , end : 1 } ;
53
53
expect ( tc . bounds ( ) ) . not . toBe ( bounds ) ;
54
54
expect ( tc . bounds . bind ( tc , bounds ) ) . not . toThrow ( ) ;
55
- expect ( tc . bounds ( ) ) . toBe ( bounds ) ;
55
+ expect ( tc . bounds ( ) ) . toEqual ( bounds ) ;
56
56
} ) ;
57
57
58
58
it ( "Disallows setting of invalid bounds" , function ( ) {
59
59
bounds = { start : 1 , end : 0 } ;
60
- expect ( tc . bounds ( ) ) . not . toBe ( bounds ) ;
60
+ expect ( tc . bounds ( ) ) . not . toEqual ( bounds ) ;
61
61
expect ( tc . bounds . bind ( tc , bounds ) ) . toThrow ( ) ;
62
- expect ( tc . bounds ( ) ) . not . toBe ( bounds ) ;
62
+ expect ( tc . bounds ( ) ) . not . toEqual ( bounds ) ;
63
63
64
64
bounds = { start : 1 } ;
65
- expect ( tc . bounds ( ) ) . not . toBe ( bounds ) ;
65
+ expect ( tc . bounds ( ) ) . not . toEqual ( bounds ) ;
66
66
expect ( tc . bounds . bind ( tc , bounds ) ) . toThrow ( ) ;
67
- expect ( tc . bounds ( ) ) . not . toBe ( bounds ) ;
67
+ expect ( tc . bounds ( ) ) . not . toEqual ( bounds ) ;
68
68
} ) ;
69
69
70
70
it ( "Allows setting of time system with bounds" , function ( ) {
@@ -106,5 +106,17 @@ define(['./TimeConductor'], function (TimeConductor) {
106
106
tc . follow ( follow ) ;
107
107
expect ( eventListener ) . toHaveBeenCalledWith ( follow ) ;
108
108
} ) ;
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
+ } ) ;
109
121
} ) ;
110
122
} ) ;
0 commit comments