[Plugins] Bring over timeline, clock plugins

WTD-1239
This commit is contained in:
Victor Woeltjen
2015-09-14 16:45:38 -07:00
parent 8c1b70f085
commit c932e953bc
119 changed files with 10485 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
/*global define,describe,it,expect,beforeEach,waitsFor,jasmine,window,afterEach*/
define(
['../src/TimelineFormatter'],
function (TimelineFormatter) {
'use strict';
var SECOND = 1000,
MINUTE = SECOND * 60,
HOUR = MINUTE * 60,
DAY = HOUR * 24;
describe("The timeline formatter", function () {
var formatter;
beforeEach(function () {
formatter = new TimelineFormatter();
});
it("formats durations with seconds", function () {
expect(formatter.format(SECOND)).toEqual("000 00:00:01.000");
});
it("formats durations with milliseconds", function () {
expect(formatter.format(SECOND + 42)).toEqual("000 00:00:01.042");
});
it("formats durations with days", function () {
expect(formatter.format(3 * DAY + SECOND)).toEqual("003 00:00:01.000");
});
it("formats durations with hours", function () {
expect(formatter.format(DAY + HOUR * 11 + SECOND)).toEqual("001 11:00:01.000");
});
it("formats durations with minutes", function () {
expect(formatter.format(HOUR + MINUTE * 21)).toEqual("000 01:21:00.000");
});
});
}
);