[Fixed Position] Add unit tests

This commit is contained in:
Aaron Doubek-Kraft
2017-06-29 15:22:39 -07:00
parent 3ed0880c6e
commit aa8f780e4e
4 changed files with 134 additions and 9 deletions

View File

@@ -24,6 +24,8 @@ define(
['../../src/elements/LineHandle'],
function (LineHandle) {
var GRID_SIZE = [45,21];
describe("A fixed position drag handle", function () {
var testElement,
handle;
@@ -33,10 +35,11 @@ define(
x: 3,
y: 42,
x2: 8,
y2: 11
y2: 11,
useGrid: true
};
handle = new LineHandle(testElement, 'x', 'y', 'x2', 'y2');
handle = new LineHandle(testElement, 'x', 'y', 'x2', 'y2', GRID_SIZE);
});
it("provides x/y grid coordinates for its corner", function () {
@@ -67,6 +70,9 @@ define(
expect(testElement.y).not.toEqual(testElement.y2);
});
it("returns the correct grid size", function () {
expect(handle.getGridSize()).toEqual([45,21]);
});
});
}