openmct/platform/commonUI/general/test/controllers/SelectorControllerSpec.js
Victor Woeltjen e411e67c81 [Forms] Add placeholder spec
Add placeholder spec for SelectorController, WTD-987.
2015-03-10 07:40:01 -07:00

46 lines
1.3 KiB
JavaScript

/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
define(
["../../src/controllers/SelectorController"],
function (SelectorController) {
"use strict";
describe("The controller for the 'selector' control", function () {
var mockObjectService,
mockScope,
controller;
function promiseOf(v) {
return (v || {}).then ? v : {
then: function (callback) {
return promiseOf(callback(v));
}
};
}
beforeEach(function () {
mockObjectService = jasmine.createSpyObj(
'objectService',
['getObjects']
);
mockScope = jasmine.createSpyObj(
'$scope',
['$watch', '$watchCollection']
);
mockObjectService.getObjects.andReturn(promiseOf({}));
controller = new SelectorController(
mockObjectService,
mockScope
);
});
it("loads the root object", function () {
expect(mockObjectService.getObjects)
.toHaveBeenCalledWith(["ROOT"]);
});
});
}
);