openmct/platform/features/timeline/test/controllers/TimelineTableControllerSpec.js
2015-09-14 16:45:41 -07:00

32 lines
975 B
JavaScript

/*global define,describe,it,expect,beforeEach,waitsFor,jasmine,window,afterEach*/
define(
[
'../../src/controllers/TimelineTableController',
'../../src/TimelineFormatter'
],
function (TimelineTableController, TimelineFormatter) {
"use strict";
describe("The timeline table controller", function () {
var formatter, controller;
beforeEach(function () {
controller = new TimelineTableController();
formatter = new TimelineFormatter();
});
// This controller's job is just to expose the formatter
// in scope, so simply verify that the two agree.
it("formats durations", function () {
[ 0, 100, 4123, 93600, 748801230012].forEach(function (n) {
expect(controller.niceTime(n))
.toEqual(formatter.format(n));
});
});
});
}
);