[Fixed Position] Add unit tests
This commit is contained in:
@@ -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]);
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user