diff --git a/magnum_ui/static/dashboard/container-infra/cluster-templates/create/labels/cluster-template.labels.controller.spec.js b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/labels/cluster-template.labels.controller.spec.js new file mode 100644 index 00000000..52f81c15 --- /dev/null +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/labels/cluster-template.labels.controller.spec.js @@ -0,0 +1,38 @@ +/** + * (c) Copyright 2016 NEC Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +(function() { + 'use strict'; + + describe('createClusterTemplateLabelsController tests', function() { + var controller; + + beforeEach(module('horizon.dashboard.container-infra.cluster-templates')); + + beforeEach(inject(function ($injector) { + controller = $injector.get('$controller'); + })); + + function createController() { + return controller('createClusterTemplateLabelsController'); + } + + it('should initialise the controller when created', function() { + var ctrl = createController({}); + expect(ctrl).toBeDefined(); + }); + }); +})(); diff --git a/magnum_ui/static/dashboard/container-infra/cluster-templates/create/network/cluster-template.network.controller.spec.js b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/network/cluster-template.network.controller.spec.js new file mode 100644 index 00000000..6964714a --- /dev/null +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/network/cluster-template.network.controller.spec.js @@ -0,0 +1,38 @@ +/** + * (c) Copyright 2016 NEC Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +(function() { + 'use strict'; + + describe('createClusterTemplateNetworkController tests', function() { + var controller; + + beforeEach(module('horizon.dashboard.container-infra.cluster-templates')); + + beforeEach(inject(function ($injector) { + controller = $injector.get('$controller'); + })); + + function createController() { + return controller('createClusterTemplateNetworkController'); + } + + it('should initialise the controller when created', function() { + var ctrl = createController({}); + expect(ctrl).toBeDefined(); + }); + }); +})(); diff --git a/magnum_ui/static/dashboard/container-infra/cluster-templates/create/spec/cluster-template.spec.controller.spec.js b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/spec/cluster-template.spec.controller.spec.js new file mode 100644 index 00000000..2524bf1a --- /dev/null +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/spec/cluster-template.spec.controller.spec.js @@ -0,0 +1,51 @@ +/** + * (c) Copyright 2016 NEC Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +(function() { + 'use strict'; + + describe('createClusterTemplateSpecController tests', function() { + var controller, glance, nova; + + function fakePromise() { + return { success: angular.noop }; + } + + beforeEach(module('horizon.dashboard.container-infra.cluster-templates')); + + beforeEach(inject(function ($injector) { + controller = $injector.get('$controller'); + glance = $injector.get('horizon.app.core.openstack-service-api.glance'); + nova = $injector.get('horizon.app.core.openstack-service-api.nova'); + + spyOn(glance, 'getImages').and.callFake(fakePromise); + spyOn(nova, 'getFlavors').and.callFake(fakePromise); + spyOn(nova, 'getKeypairs').and.callFake(fakePromise); + })); + + function createController(scope) { + return controller('createClusterTemplateSpecController', {$scope: scope}); + } + + it('should initialise the controller when created', function() { + var ctrl = createController({}); + expect(ctrl.images).toBeDefined(); + expect(ctrl.nflavors).toBeDefined(); + expect(ctrl.mflavors).toBeDefined(); + expect(ctrl.keypairs).toBeDefined(); + }); + }); +})();