mirror of
https://github.com/nasa/openmct.git
synced 2025-01-25 21:59:23 +00:00
[Time Conductor] Update telemetryFormatter spec
This commit is contained in:
parent
920c83771d
commit
f30a2dd791
@ -27,16 +27,35 @@ define(
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
describe("The telemetry formatter", function () {
|
describe("The telemetry formatter", function () {
|
||||||
var formatter;
|
var mockFormatService,
|
||||||
|
mockFormat,
|
||||||
|
formatter;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
formatter = new TelemetryFormatter();
|
mockFormatService =
|
||||||
|
jasmine.createSpyObj("formatService", ["getFormat"]);
|
||||||
|
mockFormat = jasmine.createSpyObj("format", [
|
||||||
|
"validate",
|
||||||
|
"parse",
|
||||||
|
"format"
|
||||||
|
]);
|
||||||
|
mockFormatService.getFormat.andReturn(mockFormat);
|
||||||
|
formatter = new TelemetryFormatter(mockFormatService);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("formats domains using YYYY-DDD style", function () {
|
it("formats domains using the formatService", function () {
|
||||||
expect(formatter.formatDomainValue(402513731000)).toEqual(
|
var testValue = 12321, testResult = "some result";
|
||||||
"1982-276 17:22:11"
|
mockFormat.format.andReturn(testResult);
|
||||||
);
|
|
||||||
|
expect(formatter.formatDomainValue(testValue))
|
||||||
|
.toEqual(testResult);
|
||||||
|
expect(mockFormat.format).toHaveBeenCalledWith(testValue);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("passes format keys to the formatService", function () {
|
||||||
|
formatter.formatDomainValue(12321, "someKey");
|
||||||
|
expect(mockFormatService.getFormat)
|
||||||
|
.toHaveBeenCalledWith("someKey");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("formats ranges as values", function () {
|
it("formats ranges as values", function () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user