mirror of
https://github.com/nasa/openmct.git
synced 2025-01-19 03:06:54 +00:00
[Timeline] Test zoom controller's width
This commit is contained in:
parent
be9f56107c
commit
4f0e3fdf85
@ -119,6 +119,27 @@ define(
|
||||
expect(Math.round(controller.toMillis(x2)))
|
||||
.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));
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user