[Timeline] Test zoom controller's width

This commit is contained in:
Victor Woeltjen 2016-05-31 16:21:40 -07:00
parent be9f56107c
commit 4f0e3fdf85

View File

@ -119,6 +119,27 @@ define(
expect(Math.round(controller.toMillis(x2))) expect(Math.round(controller.toMillis(x2)))
.toBeGreaterThan(testEnd); .toBeGreaterThan(testEnd);
}); });
it("provides a width which is not less than scroll area width", function () {
var testPixel = mockScope.scroll.width / 4,
testMillis = controller.toMillis(testPixel);
expect(controller.width(testMillis))
.toEqual(mockScope.scroll.width);
});
it("provides a width with some margin past timestamp", function () {
var testPixel = mockScope.scroll.width * 4,
testMillis = controller.toMillis(testPixel);
expect(controller.width(testMillis))
.toBeGreaterThan(controller.toPixels(testMillis));
});
it("provides a width which does not greatly exceed timestamp", function () {
var testPixel = mockScope.scroll.width * 4,
testMillis = controller.toMillis(testPixel);
expect(controller.width(testMillis))
.toBeLessThan(controller.toPixels(testMillis * 2));
});
}); });
}); });