1eaca69d89
This patch adds CA rotate action for cluster as item action. Change-Id: Ib269f89f2c11c0e5cfa7db6cdadd30b879887d18 Implements: blueprint add-ca-rotate
52 lines
1.6 KiB
JavaScript
52 lines
1.6 KiB
JavaScript
/**
|
|
* 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('horizon.dashboard.container-infra.clusters.rotate-certificate.service', function() {
|
|
|
|
var service, selected, magnum;
|
|
|
|
function fakePromise() {
|
|
return { success: angular.noop };
|
|
}
|
|
|
|
beforeEach(module('horizon.app.core'));
|
|
beforeEach(module('horizon.framework'));
|
|
beforeEach(module('horizon.dashboard.container-infra.clusters'));
|
|
|
|
beforeEach(inject(function($injector) {
|
|
service = $injector.get(
|
|
'horizon.dashboard.container-infra.clusters.rotate-certificate.service');
|
|
magnum = $injector.get('horizon.app.core.openstack-service-api.magnum');
|
|
spyOn(magnum, 'rotateCertificate').and.callFake(fakePromise);
|
|
}));
|
|
|
|
it('should check the policy', function() {
|
|
var allowed = service.allowed();
|
|
expect(allowed).toBeTruthy();
|
|
});
|
|
|
|
it('should get magnum.rotatecertificate', function() {
|
|
selected = {
|
|
id: '1'
|
|
};
|
|
service.initAction();
|
|
service.perform(selected);
|
|
expect(magnum.rotateCertificate).toHaveBeenCalled();
|
|
});
|
|
});
|
|
})();
|