mirror of
https://github.com/nasa/openmct.git
synced 2024-12-22 06:27:48 +00:00
e411e67c81
Add placeholder spec for SelectorController, WTD-987.
46 lines
1.3 KiB
JavaScript
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"]);
|
|
});
|
|
});
|
|
}
|
|
);
|