diff --git a/platform/features/layout/test/FixedControllerSpec.js b/platform/features/layout/test/FixedControllerSpec.js index c8b943cc62..9d2ffa9e95 100644 --- a/platform/features/layout/test/FixedControllerSpec.js +++ b/platform/features/layout/test/FixedControllerSpec.js @@ -167,6 +167,19 @@ define( expect(controller.selected(elements[1])).toBeTruthy(); }); + it("allows selection retrieval", function () { + // selected with no arguments should give the current + // selection + var elements; + + testModel.modified = 1; + findWatch("model.modified")(testModel.modified); + + elements = controller.getElements(); + controller.select(elements[1]); + expect(controller.selected()).toEqual(elements[1]); + }); + it("allows selections to be cleared", function () { var elements; @@ -288,6 +301,27 @@ define( // elements to size SVGs appropriately expect(controller.getGridSize()).toEqual(testGrid); }); + + it("exposes drag handles", function () { + var handles; + + // Select something so that drag handles are expected + testModel.modified = 1; + findWatch("model.modified")(testModel.modified); + controller.select(controller.getElements()[1]); + + // Should have a non-empty array of handles + handles = controller.handles(); + expect(handles).toEqual(jasmine.any(Array)); + expect(handles.length).not.toEqual(0); + + // And they should have start/continue/end drag methods + handles.forEach(function (handle) { + expect(handle.startDrag).toEqual(jasmine.any(Function)); + expect(handle.continueDrag).toEqual(jasmine.any(Function)); + expect(handle.endDrag).toEqual(jasmine.any(Function)); + }); + }); }); } ); \ No newline at end of file