[Time Conductor] Remove queryStart, queryEnd
...per feedback from code review, nasa/openmctweb#104
This commit is contained in:
@@ -77,7 +77,7 @@ define(
|
||||
mockElement = jasmine.createSpyObj('element', ELEMENT_METHODS);
|
||||
mockConductor = jasmine.createSpyObj(
|
||||
'conductor',
|
||||
[ 'queryStart', 'queryEnd', 'displayStart', 'displayEnd' ]
|
||||
[ 'displayStart', 'displayEnd' ]
|
||||
);
|
||||
mockCompiledTemplate = jasmine.createSpy('template');
|
||||
mockNewScope = jasmine.createSpyObj('newScope', SCOPE_METHODS);
|
||||
@@ -127,15 +127,13 @@ define(
|
||||
});
|
||||
|
||||
it("exposes conductor state in scope", function () {
|
||||
mockConductor.queryStart.andReturn(42);
|
||||
mockConductor.queryEnd.andReturn(12321);
|
||||
mockConductor.displayStart.andReturn(1977);
|
||||
mockConductor.displayEnd.andReturn(1984);
|
||||
representer.represent(testViews[0], {});
|
||||
|
||||
expect(mockNewScope.conductor).toEqual({
|
||||
inner: { start: 1977, end: 1984 },
|
||||
outer: { start: 42, end: 12321 }
|
||||
outer: { start: 1977, end: 1984 }
|
||||
});
|
||||
});
|
||||
|
||||
@@ -154,12 +152,6 @@ define(
|
||||
|
||||
fireWatch(mockNewScope, 'conductor.inner.end', testState.inner.end);
|
||||
expect(mockConductor.displayEnd).toHaveBeenCalledWith(1984);
|
||||
|
||||
fireWatch(mockNewScope, 'conductor.outer.start', testState.outer.start);
|
||||
expect(mockConductor.queryStart).toHaveBeenCalledWith(-1977);
|
||||
|
||||
fireWatch(mockNewScope, 'conductor.outer.end', testState.outer.end);
|
||||
expect(mockConductor.queryEnd).toHaveBeenCalledWith(12321);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -43,9 +43,9 @@ define(
|
||||
|
||||
it("initializes a time conductor around the current time", function () {
|
||||
var conductor = conductorService.getConductor();
|
||||
expect(conductor.queryStart() <= TEST_NOW).toBeTruthy();
|
||||
expect(conductor.queryEnd() >= TEST_NOW).toBeTruthy();
|
||||
expect(conductor.queryEnd() > conductor.queryStart())
|
||||
expect(conductor.displayStart() <= TEST_NOW).toBeTruthy();
|
||||
expect(conductor.displayEnd() >= TEST_NOW).toBeTruthy();
|
||||
expect(conductor.displayEnd() > conductor.displayStart())
|
||||
.toBeTruthy();
|
||||
});
|
||||
|
||||
|
||||
@@ -41,19 +41,13 @@ define(
|
||||
});
|
||||
|
||||
it("provides accessors for query/display start/end times", function () {
|
||||
expect(conductor.queryStart()).toEqual(testStart);
|
||||
expect(conductor.queryEnd()).toEqual(testEnd);
|
||||
expect(conductor.displayStart()).toEqual(testStart);
|
||||
expect(conductor.displayEnd()).toEqual(testEnd);
|
||||
});
|
||||
|
||||
it("provides setters for query/display start/end times", function () {
|
||||
expect(conductor.queryStart(1)).toEqual(1);
|
||||
expect(conductor.queryEnd(2)).toEqual(2);
|
||||
expect(conductor.displayStart(3)).toEqual(3);
|
||||
expect(conductor.displayEnd(4)).toEqual(4);
|
||||
expect(conductor.queryStart()).toEqual(1);
|
||||
expect(conductor.queryEnd()).toEqual(2);
|
||||
expect(conductor.displayStart()).toEqual(3);
|
||||
expect(conductor.displayEnd()).toEqual(4);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user