[Time Conductor] Update RangeColumn spec
Update RangeColumn spec. Changes appear to have been related to limits (WTD-1337), but making changes in the context of updating tests for time conductor, https://github.com/nasa/openmctweb/issues/116
This commit is contained in:
@@ -32,16 +32,14 @@ define(
|
|||||||
var TEST_RANGE_VALUE = "some formatted range value";
|
var TEST_RANGE_VALUE = "some formatted range value";
|
||||||
|
|
||||||
describe("A range column", function () {
|
describe("A range column", function () {
|
||||||
var mockDataSet,
|
var testDatum,
|
||||||
testMetadata,
|
testMetadata,
|
||||||
mockFormatter,
|
mockFormatter,
|
||||||
|
mockDomainObject,
|
||||||
column;
|
column;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
mockDataSet = jasmine.createSpyObj(
|
testDatum = { testKey: 123, otherKey: 456 };
|
||||||
"data",
|
|
||||||
[ "getRangeValue" ]
|
|
||||||
);
|
|
||||||
mockFormatter = jasmine.createSpyObj(
|
mockFormatter = jasmine.createSpyObj(
|
||||||
"formatter",
|
"formatter",
|
||||||
[ "formatDomainValue", "formatRangeValue" ]
|
[ "formatDomainValue", "formatRangeValue" ]
|
||||||
@@ -50,6 +48,10 @@ define(
|
|||||||
key: "testKey",
|
key: "testKey",
|
||||||
name: "Test Name"
|
name: "Test Name"
|
||||||
};
|
};
|
||||||
|
mockDomainObject = jasmine.createSpyObj(
|
||||||
|
"domainObject",
|
||||||
|
[ "getModel", "getCapability" ]
|
||||||
|
);
|
||||||
mockFormatter.formatRangeValue.andReturn(TEST_RANGE_VALUE);
|
mockFormatter.formatRangeValue.andReturn(TEST_RANGE_VALUE);
|
||||||
|
|
||||||
column = new RangeColumn(testMetadata, mockFormatter);
|
column = new RangeColumn(testMetadata, mockFormatter);
|
||||||
@@ -59,20 +61,13 @@ define(
|
|||||||
expect(column.getTitle()).toEqual("Test Name");
|
expect(column.getTitle()).toEqual("Test Name");
|
||||||
});
|
});
|
||||||
|
|
||||||
xit("looks up data from a data set", function () {
|
it("formats range values as numbers", function () {
|
||||||
column.getValue(undefined, mockDataSet, 42);
|
expect(column.getValue(mockDomainObject, testDatum).text)
|
||||||
expect(mockDataSet.getRangeValue)
|
|
||||||
.toHaveBeenCalledWith(42, "testKey");
|
|
||||||
});
|
|
||||||
|
|
||||||
xit("formats range values as numbers", function () {
|
|
||||||
mockDataSet.getRangeValue.andReturn(123.45678);
|
|
||||||
expect(column.getValue(undefined, mockDataSet, 42).text)
|
|
||||||
.toEqual(TEST_RANGE_VALUE);
|
.toEqual(TEST_RANGE_VALUE);
|
||||||
|
|
||||||
// Make sure that service interactions were as expected
|
// Make sure that service interactions were as expected
|
||||||
expect(mockFormatter.formatRangeValue)
|
expect(mockFormatter.formatRangeValue)
|
||||||
.toHaveBeenCalledWith(123.45678);
|
.toHaveBeenCalledWith(testDatum.testKey);
|
||||||
expect(mockFormatter.formatDomainValue)
|
expect(mockFormatter.formatDomainValue)
|
||||||
.not.toHaveBeenCalled();
|
.not.toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user