{{::$ctrl.secret.objectMeta.creationTimestamp | relativeTime}}
diff --git a/src/app/frontend/secretlist/secretcard_component.js b/src/app/frontend/secretlist/secretcard_component.js
index b9c4f279122550eefd758e858a0ec29ce390361c..bf06e60dfb15f761625867fd2f054341861ef8dd 100644
--- a/src/app/frontend/secretlist/secretcard_component.js
+++ b/src/app/frontend/secretlist/secretcard_component.js
@@ -2,8 +2,9 @@ class SecretCardController {
/**
* @ngInject
* @param {!angular.$interpolate} $interpolate
+ * @param {!./../common/namespace/namespace_service.NamespaceService} kdNamespaceService
*/
- constructor($interpolate) {
+ constructor($interpolate, kdNamespaceService) {
/**
* Secret initialised from scope
* @export {!backendApi.Secret}
@@ -12,6 +13,17 @@ class SecretCardController {
/** @private {!angular.$interpolate} */
this.interpolate_ = $interpolate;
+
+ /** @private {!./../common/namespace/namespace_service.NamespaceService} */
+ this.kdNamespaceService_ = kdNamespaceService;
+ }
+
+ /**
+ * @return {boolean}
+ * @export
+ */
+ areMultipleNamespacesSelected() {
+ return this.kdNamespaceService_.areMultipleNamespacesSelected();
}
/**
diff --git a/src/app/frontend/secretlist/secretcardlist.html b/src/app/frontend/secretlist/secretcardlist.html
index 92d2ce2217997b728cca1b8378fb31b7728b14b8..4a32dfc56ee8a8e58cd9378177aa71832b0c14c8 100644
--- a/src/app/frontend/secretlist/secretcardlist.html
+++ b/src/app/frontend/secretlist/secretcardlist.html
@@ -18,6 +18,9 @@ limitations under the License.
{{::$ctrl.i18n.MSG_SECRET_LIST_NAME_LABEL}}
+
+ {{::$ctrl.i18n.MSG_SECRET_LIST_NAMESPACE_LABEL}}
+
{{::$ctrl.i18n.MSG_SECRET_LIST_AGE_LABEL}}
diff --git a/src/app/frontend/secretlist/secretcardlist_component.js b/src/app/frontend/secretlist/secretcardlist_component.js
index 3621856b76ff1fe45a033463cf248b64d91fbda5..254cd5811525a1195e90437be90100a6e0075e21 100644
--- a/src/app/frontend/secretlist/secretcardlist_component.js
+++ b/src/app/frontend/secretlist/secretcardlist_component.js
@@ -16,11 +16,25 @@
* @final
*/
export class SecretCardListController {
- /** @ngInject */
- constructor() {
+ /**
+ * @param {!./../common/namespace/namespace_service.NamespaceService} kdNamespaceService
+ * @ngInject
+ */
+ constructor(kdNamespaceService) {
+ /** @private {!./../common/namespace/namespace_service.NamespaceService} */
+ this.kdNamespaceService_ = kdNamespaceService;
+
/** @export */
this.i18n = i18n;
}
+
+ /**
+ * @return {boolean}
+ * @export
+ */
+ areMultipleNamespacesSelected() {
+ return this.kdNamespaceService_.areMultipleNamespacesSelected();
+ }
}
/**
@@ -42,6 +56,9 @@ const i18n = {
/** @export {string} @desc Label 'Name' which appears as a column label in the table of
secrets (secret list view). */
MSG_SECRET_LIST_NAME_LABEL: goog.getMsg('Name'),
+ /** @export {string} @desc Label 'Namespace' which appears as a column label in the
+ table of secrets (secret list view). */
+ MSG_SECRET_LIST_NAMESPACE_LABEL: goog.getMsg('Namespace'),
/** @export {string} @desc Label 'Age' which appears as a column label in the
table of secrets (secret list view). */
MSG_SECRET_LIST_AGE_LABEL: goog.getMsg('Age'),
diff --git a/src/app/frontend/secretlist/secretlist_module.js b/src/app/frontend/secretlist/secretlist_module.js
index 51b622b63fb7d1f7c1eac3486e5e3fbbd721fdd7..4afd8913ec98d972d94a94e9fb8335bf520de83c 100644
--- a/src/app/frontend/secretlist/secretlist_module.js
+++ b/src/app/frontend/secretlist/secretlist_module.js
@@ -17,6 +17,7 @@ import stateConfig from './secretlist_stateconfig';
import paginationModule from 'common/pagination/pagination_module';
import componentsModule from 'common/components/components_module';
import filtersModule from 'common/filters/filters_module';
+import namespaceModule from 'common/namespace/namespace_module';
import {secretCardListComponent} from './secretcardlist_component';
import {secretCardComponent} from './secretcard_component';
@@ -36,6 +37,7 @@ export default angular
componentsModule.name,
paginationModule.name,
filtersModule.name,
+ namespaceModule.name,
])
.config(stateConfig)
.component('kdSecretCardList', secretCardListComponent)
diff --git a/src/app/frontend/servicelist/servicecard.html b/src/app/frontend/servicelist/servicecard.html
index c6630cec638d6d51519c489d0d15ced1309df727..9f0a2d23e35c116f3987c42bc997f1936feff3dd 100644
--- a/src/app/frontend/servicelist/servicecard.html
+++ b/src/app/frontend/servicelist/servicecard.html
@@ -32,6 +32,12 @@ limitations under the License.
+
+
+
+
+
+
diff --git a/src/app/frontend/servicelist/servicecard_component.js b/src/app/frontend/servicelist/servicecard_component.js
index 6f14a0cd9c474f0d2c4a1faa441ddb50a6b25ac2..648bd6cd017af6e4de9df2d2af44fb7abf5a8773 100644
--- a/src/app/frontend/servicelist/servicecard_component.js
+++ b/src/app/frontend/servicelist/servicecard_component.js
@@ -21,9 +21,13 @@ import {stateName} from 'servicedetail/servicedetail_state';
export class ServiceCardController {
/**
* @param {!ui.router.$state} $state
+ * @param {!./../common/namespace/namespace_service.NamespaceService} kdNamespaceService
* @ngInject
*/
- constructor($state) {
+ constructor($state, kdNamespaceService) {
+ /** @private {!./../common/namespace/namespace_service.NamespaceService} */
+ this.kdNamespaceService_ = kdNamespaceService;
+
/** @export {!backendApi.Service} */
this.service;
@@ -34,6 +38,14 @@ export class ServiceCardController {
this.i18n = i18n;
}
+ /**
+ * @return {boolean}
+ * @export
+ */
+ areMultipleNamespacesSelected() {
+ return this.kdNamespaceService_.areMultipleNamespacesSelected();
+ }
+
/**
* @return {string}
* @export
diff --git a/src/app/frontend/servicelist/servicecardlist.html b/src/app/frontend/servicelist/servicecardlist.html
index e6d4dbc6b180e8129484f982fbae4e7253256230..082977076a180c408b7b637299e3823e6ac05622 100644
--- a/src/app/frontend/servicelist/servicecardlist.html
+++ b/src/app/frontend/servicelist/servicecardlist.html
@@ -19,6 +19,9 @@ limitations under the License.
{{::$ctrl.i18n.MSG_SERVICE_LIST_NAME_LABEL}}
+
+ {{::$ctrl.i18n.MSG_SERVICE_LIST_NAMESPACE_LABEL}}
+
{{::$ctrl.i18n.MSG_SERVICE_LIST_LABELS_LABEL}}
diff --git a/src/app/frontend/servicelist/servicecardlist_component.js b/src/app/frontend/servicelist/servicecardlist_component.js
index e13fdf63d84a5f97324acd90ba1487aa4cf19f75..93562742c5baf226279e6e7a5f3621397e0dfdad 100644
--- a/src/app/frontend/servicelist/servicecardlist_component.js
+++ b/src/app/frontend/servicelist/servicecardlist_component.js
@@ -16,11 +16,25 @@
* @final
*/
export class ServiceCardListController {
- /** @ngInject */
- constructor() {
+ /**
+ * @param {!./../common/namespace/namespace_service.NamespaceService} kdNamespaceService
+ * @ngInject
+ */
+ constructor(kdNamespaceService) {
+ /** @private {!./../common/namespace/namespace_service.NamespaceService} */
+ this.kdNamespaceService_ = kdNamespaceService;
+
/** @export */
this.i18n = i18n;
}
+
+ /**
+ * @return {boolean}
+ * @export
+ */
+ areMultipleNamespacesSelected() {
+ return this.kdNamespaceService_.areMultipleNamespacesSelected();
+ }
}
/**
@@ -45,6 +59,9 @@ const i18n = {
/** @export {string} @desc Label 'Name' which appears as a column label in the table of
services (service list view). */
MSG_SERVICE_LIST_NAME_LABEL: goog.getMsg('Name'),
+ /** @export {string} @desc Label 'Namespace' which appears as a column label in the
+ table of services (service list view). */
+ MSG_SERVICE_LIST_NAMESPACE_LABEL: goog.getMsg('Namespace'),
/** @export {string} @desc Label 'Labels' which appears as a column label in the table of
services (service list view). */
MSG_SERVICE_LIST_LABELS_LABEL: goog.getMsg('Labels'),
diff --git a/src/app/frontend/servicelist/servicelist_module.js b/src/app/frontend/servicelist/servicelist_module.js
index 3a368f300f9e9702555e570a6f9274487c0d6916..c2698e7bdf1fcca517841ec563a9b79832890285 100644
--- a/src/app/frontend/servicelist/servicelist_module.js
+++ b/src/app/frontend/servicelist/servicelist_module.js
@@ -15,6 +15,7 @@
import componentsModule from 'common/components/components_module';
import chromeModule from 'chrome/chrome_module';
import filtersModule from 'common/filters/filters_module';
+import namespaceModule from 'common/namespace/namespace_module';
import stateConfig from './servicelist_stateconfig';
import {serviceCardListComponent} from './servicecardlist_component';
import {serviceCardComponent} from './servicecard_component';
@@ -34,6 +35,7 @@ export default angular
filtersModule.name,
componentsModule.name,
chromeModule.name,
+ namespaceModule.name,
])
.config(stateConfig)
.component('kdServiceCardList', serviceCardListComponent)
diff --git a/src/test/frontend/common/namespace/namespace_service_test.js b/src/test/frontend/common/namespace/namespace_service_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..10952fe300d002eac5319d9fc185e7d91f619e79
--- /dev/null
+++ b/src/test/frontend/common/namespace/namespace_service_test.js
@@ -0,0 +1,40 @@
+// Copyright 2015 Google Inc. All Rights Reserved.
+//
+// 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.
+
+import namespaceModule from 'common/namespace/namespace_module';
+
+describe('Namespace service', () => {
+ /** @type {!common/namespace/namespace_service.NamespaceService} */
+ let namespaceService;
+
+ beforeEach(() => angular.mock.module(namespaceModule.name));
+
+ beforeEach(angular.mock.inject((kdNamespaceService) => {
+ namespaceService = kdNamespaceService;
+
+ }));
+
+ it(`should initialise multipleNamespacesSelected as true`,
+ () => { expect(namespaceService.areMultipleNamespacesSelected()).toBe(true); });
+
+ it(`should set multipleNamespacesSelected to true`, () => {
+ namespaceService.setMultipleNamespacesSelected(true);
+ expect(namespaceService.areMultipleNamespacesSelected()).toBe(true);
+ });
+
+ it(`should set multipleNamespacesSelected to false`, () => {
+ namespaceService.setMultipleNamespacesSelected(false);
+ expect(namespaceService.areMultipleNamespacesSelected()).toBe(false);
+ });
+});
diff --git a/src/test/frontend/common/namespace/namespaceselect_component_test.js b/src/test/frontend/common/namespace/namespaceselect_component_test.js
index 1b10c482221aec374a03554cb29cb25f0ae83270..64ec0ca97879c083e3b77d0cc6f38170a28bda35 100644
--- a/src/test/frontend/common/namespace/namespaceselect_component_test.js
+++ b/src/test/frontend/common/namespace/namespaceselect_component_test.js
@@ -21,6 +21,8 @@ describe('Namespace select component ', () => {
let scope;
/** @type {!common/namespace/namespaceselect_component.NamespaceSelectController} */
let ctrl;
+ /** @type {!common/namespace/namespace_service.NamespaceService} */
+ let service;
/** @type {!angular.$httpBackend} */
let httpBackend;
/** @type {!ui.router.$state} */
@@ -39,12 +41,14 @@ describe('Namespace select component ', () => {
angular.mock.module(fakeModule.name);
angular.mock.module(chromeModule.name);
- angular.mock.inject(($componentController, $rootScope, $httpBackend, $state) => {
- scope = $rootScope;
- ctrl = $componentController('kdNamespaceSelect', {$scope: $rootScope});
- httpBackend = $httpBackend;
- state = $state;
- });
+ angular.mock.inject(
+ ($componentController, $rootScope, $httpBackend, $state, kdNamespaceService) => {
+ scope = $rootScope;
+ ctrl = $componentController('kdNamespaceSelect', {$scope: $rootScope});
+ service = kdNamespaceService;
+ httpBackend = $httpBackend;
+ state = $state;
+ });
});
it('should initialize from non-exisitng namespace and watch for state changes', () => {
@@ -106,4 +110,15 @@ describe('Namespace select component ', () => {
ctrl.selectedNamespace = 'foo';
expect(ctrl.formatNamespace('foo')).toBe('foo');
});
+
+ it('should change this.isMultipleNamespaces depending on namespaces selected', () => {
+ ctrl.$onInit();
+
+ expect(service.areMultipleNamespacesSelected()).toBe(true);
+
+ scope.$broadcast('$stateChangeSuccess', {}, {namespace: 'a'});
+ scope.$digest();
+ expect(ctrl.selectedNamespace).toBe('a');
+ expect(service.areMultipleNamespacesSelected()).toBe(false);
+ });
});
diff --git a/src/test/frontend/configmaplist/configmapcardlist_component_test.js b/src/test/frontend/configmaplist/configmapcardlist_component_test.js
index 270f1cf0fc301d15149bc3a3b282afb82f0bb3cf..87ed8de40856685ebeb25437d636cb242efa2685 100644
--- a/src/test/frontend/configmaplist/configmapcardlist_component_test.js
+++ b/src/test/frontend/configmaplist/configmapcardlist_component_test.js
@@ -16,14 +16,28 @@ import configMapListModule from 'configmaplist/configmaplist_module';
describe('Config Map card list', () => {
/** @type {!configmaplist/configmapcard_component.ConfigMapCardListController} */
let ctrl;
+ /**
+ * @type {!./../common/namespace/namespace_service.NamespaceService}
+ */
+ let data;
beforeEach(() => {
angular.mock.module(configMapListModule.name);
- angular.mock.inject(($componentController, $rootScope) => {
- ctrl = $componentController('kdConfigMapCardList', {$scope: $rootScope});
+ angular.mock.inject(($componentController, $rootScope, kdNamespaceService) => {
+ /** @type {!./../common/namespace/namespace_service.NamespaceService} */
+ data = kdNamespaceService;
+ /** @type {!ConfigMapCardListController} */
+ ctrl = $componentController(
+ 'kdConfigMapCardList', {$scope: $rootScope, kdNamespaceService_: data}, {});
});
});
+ it('should instantiate the controller properly', () => { expect(ctrl).not.toBeUndefined(); });
+
+ it('should return the value from Namespace service', () => {
+ expect(ctrl.areMultipleNamespacesSelected()).toBe(data.areMultipleNamespacesSelected());
+ });
+
it('should init i18n', () => { expect(ctrl.i18n).not.toBeUndefined(); });
});
diff --git a/src/test/frontend/daemonsetlist/daemonsetcardlist_component_test.js b/src/test/frontend/daemonsetlist/daemonsetcardlist_component_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..fdbe84d47bf849db7618455c3171de177b66b821
--- /dev/null
+++ b/src/test/frontend/daemonsetlist/daemonsetcardlist_component_test.js
@@ -0,0 +1,43 @@
+// Copyright 2015 Google Inc. All Rights Reserved.
+//
+// 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.
+
+import daemonsetListModule from 'daemonsetlist/daemonsetlist_module';
+
+describe('Daemon Set Card List controller', () => {
+ /**
+ * @type {!daemonsetlist/daemonsetcardlist_component.DaemonSetCardListController}
+ */
+ let ctrl;
+ /**
+ * @type {!./../common/namespace/namespace_service.NamespaceService}
+ */
+ let data;
+
+ beforeEach(() => {
+ angular.mock.module(daemonsetListModule.name);
+
+ angular.mock.inject(($componentController, kdNamespaceService) => {
+ /** @type {!./../common/namespace/namespace_service.NamespaceService} */
+ data = kdNamespaceService;
+ /** @type {!DaemonSetCardListController} */
+ ctrl = $componentController('kdDaemonSetCardList', {kdNamespaceService_: data});
+ });
+ });
+
+ it('should instantiate the controller properly', () => { expect(ctrl).not.toBeUndefined(); });
+
+ it('should return the value from Namespace service', () => {
+ expect(ctrl.areMultipleNamespacesSelected()).toBe(data.areMultipleNamespacesSelected());
+ });
+});
diff --git a/src/test/frontend/deploymentlist/deploymentcardlist_component_test.js b/src/test/frontend/deploymentlist/deploymentcardlist_component_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..0f6eafe6f3c4289cadf27784db14f972d2088b1c
--- /dev/null
+++ b/src/test/frontend/deploymentlist/deploymentcardlist_component_test.js
@@ -0,0 +1,43 @@
+// Copyright 2015 Google Inc. All Rights Reserved.
+//
+// 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.
+
+import deploymentListModule from 'deploymentlist/deploymentlist_module';
+
+describe('Deployment Card List controller', () => {
+ /**
+ * @type {!deploymentlist/deploymentcardlist_component.DeploymentCardListController}
+ */
+ let ctrl;
+ /**
+ * @type {!./../common/namespace/namespace_service.NamespaceService}
+ */
+ let data;
+
+ beforeEach(() => {
+ angular.mock.module(deploymentListModule.name);
+
+ angular.mock.inject(($componentController, kdNamespaceService) => {
+ /** @type {!./../common/namespace/namespace_service.NamespaceService} */
+ data = kdNamespaceService;
+ /** @type {!DeploymentCardListController} */
+ ctrl = $componentController('kdDeploymentCardList', {kdNamespaceService_: data});
+ });
+ });
+
+ it('should instantiate the controller properly', () => { expect(ctrl).not.toBeUndefined(); });
+
+ it('should return the value from Namespace service', () => {
+ expect(ctrl.areMultipleNamespacesSelected()).toBe(data.areMultipleNamespacesSelected());
+ });
+});
diff --git a/src/test/frontend/joblist/jobcardlist_component_test.js b/src/test/frontend/joblist/jobcardlist_component_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..60f5731a27e80290a5f9e55e71525305b674abd1
--- /dev/null
+++ b/src/test/frontend/joblist/jobcardlist_component_test.js
@@ -0,0 +1,43 @@
+// Copyright 2015 Google Inc. All Rights Reserved.
+//
+// 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.
+
+import jobListModule from 'joblist/joblist_module';
+
+describe('Job Card List controller', () => {
+ /**
+ * @type {!joblist/jobcardlist_component.JobCardListController}
+ */
+ let ctrl;
+ /**
+ * @type {!./../common/namespace/namespace_service.NamespaceService}
+ */
+ let data;
+
+ beforeEach(() => {
+ angular.mock.module(jobListModule.name);
+
+ angular.mock.inject(($componentController, kdNamespaceService) => {
+ /** @type {!./../common/namespace/namespace_service.NamespaceService} */
+ data = kdNamespaceService;
+ /** @type {!JobCardListController} */
+ ctrl = $componentController('kdJobCardList', {kdNamespaceService_: data});
+ });
+ });
+
+ it('should instantiate the controller properly', () => { expect(ctrl).not.toBeUndefined(); });
+
+ it('should return the value from Namespace service', () => {
+ expect(ctrl.areMultipleNamespacesSelected()).toBe(data.areMultipleNamespacesSelected());
+ });
+});
diff --git a/src/test/frontend/petsetlist/petsetcardlist_component_test.js b/src/test/frontend/petsetlist/petsetcardlist_component_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..101cc152a5d2333aab44bea6185fc4ae7ca04e10
--- /dev/null
+++ b/src/test/frontend/petsetlist/petsetcardlist_component_test.js
@@ -0,0 +1,43 @@
+// Copyright 2015 Google Inc. All Rights Reserved.
+//
+// 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.
+
+import petsetListModule from 'petsetlist/petsetlist_module';
+
+describe('Pet Set Card List controller', () => {
+ /**
+ * @type {!petsetlist/petsetcardlist_component.PetSetCardListController}
+ */
+ let ctrl;
+ /**
+ * @type {!./../common/namespace/namespace_service.NamespaceService}
+ */
+ let data;
+
+ beforeEach(() => {
+ angular.mock.module(petsetListModule.name);
+
+ angular.mock.inject(($componentController, kdNamespaceService) => {
+ /** @type {!./../common/namespace/namespace_service.NamespaceService} */
+ data = kdNamespaceService;
+ /** @type {!PetSetCardListController} */
+ ctrl = $componentController('kdPetSetCardList', {kdNamespaceService_: data});
+ });
+ });
+
+ it('should instantiate the controller properly', () => { expect(ctrl).not.toBeUndefined(); });
+
+ it('should return the value from Namespace service', () => {
+ expect(ctrl.areMultipleNamespacesSelected()).toBe(data.areMultipleNamespacesSelected());
+ });
+});
diff --git a/src/test/frontend/podlist/podcardlist_component_test.js b/src/test/frontend/podlist/podcardlist_component_test.js
index 3368889889fccb2bccd6d6630b4829c79a64be10..afd3118e5f46069909ddc2a450deb250eae3e6a6 100644
--- a/src/test/frontend/podlist/podcardlist_component_test.js
+++ b/src/test/frontend/podlist/podcardlist_component_test.js
@@ -20,16 +20,30 @@ describe('Pod card list controller', () => {
* @type {!podlist/podcardlist_component.PodCardListController}
*/
let ctrl;
+ /**
+ * @type {!./../common/namespace/namespace_service.NamespaceService}
+ */
+ let data;
beforeEach(() => {
angular.mock.module(podsListModule.name);
angular.mock.module(podDetailModule.name);
- angular.mock.inject(($componentController, $rootScope) => {
- ctrl = $componentController('kdPodCardList', {$scope: $rootScope}, {});
+ angular.mock.inject(($componentController, $rootScope, kdNamespaceService) => {
+ /** @type {!./../common/namespace/namespace_service.NamespaceService} */
+ data = kdNamespaceService;
+ /** @type {!podCardListController} */
+ ctrl = $componentController(
+ 'kdPodCardList', {$scope: $rootScope, kdNamespaceService_: data}, {});
});
});
+ it('should instantiate the controller properly', () => { expect(ctrl).not.toBeUndefined(); });
+
+ it('should return the value from Namespace service', () => {
+ expect(ctrl.areMultipleNamespacesSelected()).toBe(data.areMultipleNamespacesSelected());
+ });
+
it('should execute logs href callback function', () => {
expect(ctrl.getPodDetailHref({
objectMeta: {
diff --git a/src/test/frontend/replicasetlist/replicasetcardlist_component_test.js b/src/test/frontend/replicasetlist/replicasetcardlist_component_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..1dc56c6a8caa21faa0c77635564f24a162e51c68
--- /dev/null
+++ b/src/test/frontend/replicasetlist/replicasetcardlist_component_test.js
@@ -0,0 +1,43 @@
+// Copyright 2015 Google Inc. All Rights Reserved.
+//
+// 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.
+
+import replicasetListModule from 'replicasetlist/replicasetlist_module';
+
+describe('Replica Set Card List controller', () => {
+ /**
+ * @type {!replicasetlist/replicasetcardlist_component.ReplicaSetCardListController}
+ */
+ let ctrl;
+ /**
+ * @type {!./../common/namespace/namespace_service.NamespaceService}
+ */
+ let data;
+
+ beforeEach(() => {
+ angular.mock.module(replicasetListModule.name);
+
+ angular.mock.inject(($componentController, kdNamespaceService) => {
+ /** @type {!./../common/namespace/namespace_service.NamespaceService} */
+ data = kdNamespaceService;
+ /** @type {!ReplicaSetCardListController} */
+ ctrl = $componentController('kdReplicaSetCardList', {kdNamespaceService_: data});
+ });
+ });
+
+ it('should instantiate the controller properly', () => { expect(ctrl).not.toBeUndefined(); });
+
+ it('should return the value from Namespace service', () => {
+ expect(ctrl.areMultipleNamespacesSelected()).toBe(data.areMultipleNamespacesSelected());
+ });
+});
diff --git a/src/test/frontend/replicationcontrollerlist/replicationcontrollercardlist_component_test.js b/src/test/frontend/replicationcontrollerlist/replicationcontrollercardlist_component_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..877772de264170302c7a9b4785945dd33a894365
--- /dev/null
+++ b/src/test/frontend/replicationcontrollerlist/replicationcontrollercardlist_component_test.js
@@ -0,0 +1,43 @@
+// Copyright 2015 Google Inc. All Rights Reserved.
+//
+// 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.
+
+import replicationControllerListModule from 'replicationcontrollerlist/replicationcontrollerlist_module';
+
+describe('Replication Controller Card List controller', () => {
+ /**
+ * @type {!replicationcontrollerlist/replicationcontrollercardlist_component.RCCardListController}
+ */
+ let ctrl;
+ /**
+ * @type {!./../common/namespace/namespace_service.NamespaceService}
+ */
+ let data;
+
+ beforeEach(() => {
+ angular.mock.module(replicationControllerListModule.name);
+
+ angular.mock.inject(($componentController, kdNamespaceService) => {
+ /** @type {!./../common/namespace/namespace_service.NamespaceService} */
+ data = kdNamespaceService;
+ /** @type {!RCCardListController} */
+ ctrl = $componentController('kdReplicationControllerCardList', {kdNamespaceService_: data});
+ });
+ });
+
+ it('should instantiate the controller properly', () => { expect(ctrl).not.toBeUndefined(); });
+
+ it('should return the value from Namespace service', () => {
+ expect(ctrl.areMultipleNamespacesSelected()).toBe(data.areMultipleNamespacesSelected());
+ });
+});
diff --git a/src/test/frontend/secretlist/secretcardlist_component_test.js b/src/test/frontend/secretlist/secretcardlist_component_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..8d402d3d4c4c59ad0a198add15d116f44f2ac2ea
--- /dev/null
+++ b/src/test/frontend/secretlist/secretcardlist_component_test.js
@@ -0,0 +1,43 @@
+// Copyright 2015 Google Inc. All Rights Reserved.
+//
+// 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.
+
+import secretListModule from 'secretlist/secretlist_module';
+
+describe('Secret Card List controller', () => {
+ /**
+ * @type {!secretlist/secretcardlist_component.SecretCardListController}
+ */
+ let ctrl;
+ /**
+ * @type {!./../common/namespace/namespace_service.NamespaceService}
+ */
+ let data;
+
+ beforeEach(() => {
+ angular.mock.module(secretListModule.name);
+
+ angular.mock.inject(($componentController, kdNamespaceService) => {
+ /** @type {!./../common/namespace/namespace_service.NamespaceService} */
+ data = kdNamespaceService;
+ /** @type {!SecretListController} */
+ ctrl = $componentController('kdSecretCardList', {kdNamespaceService_: data});
+ });
+ });
+
+ it('should instantiate the controller properly', () => { expect(ctrl).not.toBeUndefined(); });
+
+ it('should return the value from Namespace service', () => {
+ expect(ctrl.areMultipleNamespacesSelected()).toBe(data.areMultipleNamespacesSelected());
+ });
+});
diff --git a/src/test/frontend/servicelist/servicecardlist_component_test.js b/src/test/frontend/servicelist/servicecardlist_component_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..48d9cfbed873d8de30ff45f658a79ac0d5d64f7b
--- /dev/null
+++ b/src/test/frontend/servicelist/servicecardlist_component_test.js
@@ -0,0 +1,43 @@
+// Copyright 2015 Google Inc. All Rights Reserved.
+//
+// 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.
+
+import serviceListModule from 'servicelist/servicelist_module';
+
+describe('Service Card List controller', () => {
+ /**
+ * @type {!servicelist/servicecardlist_component.ServiceCardListController}
+ */
+ let ctrl;
+ /**
+ * @type {!./../common/namespace/namespace_service.NamespaceService}
+ * */
+ let data;
+
+ beforeEach(() => {
+ angular.mock.module(serviceListModule.name);
+
+ angular.mock.inject(($componentController, kdNamespaceService) => {
+ /** @type {!./../common/namespace/namespace_service.NamespaceService} */
+ data = kdNamespaceService;
+ /** @type {!ServiceCardListController} */
+ ctrl = $componentController('kdServiceCardList', {kdNamespaceService_: data});
+ });
+ });
+
+ it('should instantiate the controller properly', () => { expect(ctrl).not.toBeUndefined(); });
+
+ it('should return the value from Namespace service', () => {
+ expect(ctrl.areMultipleNamespacesSelected()).toBe(data.areMultipleNamespacesSelected());
+ });
+});