"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "openstack_dashboard/dashboards/identity/static/dashboard/identity/domains/actions/delete.service.spec.js" between
horizon-22.1.0.tar.gz and horizon-23.0.0.tar.gz

About: OpenStack Horizon (Optional Service: Dashboard) provides a web-based self-service portal to interact with underlying OpenStack services, such as launching an instance, assigning IP addresses and configuring access controls.
The "Zed" series (latest release).

delete.service.spec.js  (horizon-22.1.0):delete.service.spec.js  (horizon-23.0.0)
skipping to change at line 20 skipping to change at line 20
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
*/ */
(function() { (function() {
'use strict'; 'use strict';
describe('horizon.dashboard.identity.domains.actions.delete.service', function () { describe('horizon.dashboard.identity.domains.actions.delete.service', function () {
var service, $scope, deferredModal, deferredPolicy; var service, $scope, deferredModal, deferredPolicy, $httpBackend;
var deleteModalService = { var deleteModalService = {
onlyPass: false, onlyPass: false,
open: function () { open: function () {
var res = { var res = {
pass: [{context: {id: 'a'}}], pass: [{context: {id: 'a'}}],
fail: [] fail: []
}; };
if (!deleteModalService.onlyPass) { if (!deleteModalService.onlyPass) {
res.fail.push({context: {id: 'b'}}); res.fail.push({context: {id: 'b'}});
skipping to change at line 84 skipping to change at line 84
beforeEach(module('horizon.framework.widgets.modal', function($provide) { beforeEach(module('horizon.framework.widgets.modal', function($provide) {
$provide.value('horizon.framework.widgets.modal.deleteModalService', delet eModalService); $provide.value('horizon.framework.widgets.modal.deleteModalService', delet eModalService);
})); }));
beforeEach(module('horizon.app.core.openstack-service-api', function($provid e) { beforeEach(module('horizon.app.core.openstack-service-api', function($provid e) {
$provide.value('horizon.app.core.openstack-service-api.keystone', keystone API); $provide.value('horizon.app.core.openstack-service-api.keystone', keystone API);
$provide.value('horizon.app.core.openstack-service-api.policy', policyAPI) ; $provide.value('horizon.app.core.openstack-service-api.policy', policyAPI) ;
spyOn(policyAPI, 'ifAllowed').and.callThrough(); spyOn(policyAPI, 'ifAllowed').and.callThrough();
})); }));
beforeEach(inject(function($injector, _$rootScope_, $q) { beforeEach(inject(function($injector, _$rootScope_, $q, _$httpBackend_) {
$scope = _$rootScope_.$new(); $scope = _$rootScope_.$new();
$httpBackend = _$httpBackend_;
service = $injector.get('horizon.dashboard.identity.domains.actions.delete .service'); service = $injector.get('horizon.dashboard.identity.domains.actions.delete .service');
deferredModal = $q.defer(); deferredModal = $q.defer();
deferredPolicy = $q.defer(); deferredPolicy = $q.defer();
})); }));
describe('perform method and pass only', function() { describe('perform method and pass only', function() {
it('should open the delete modal', function(done) { it('should open the delete modal', function(done) {
spyOn(deleteModalService, 'open').and.callThrough(); spyOn(deleteModalService, 'open').and.callThrough();
spyOn(keystoneAPI, 'deleteDomain'); spyOn(keystoneAPI, 'deleteDomain');
deleteModalService.onlyPass = true; deleteModalService.onlyPass = true;
var domain = generateDomains(1)[0]; var domain = generateDomains(1)[0];
service.perform(domain); service.perform(domain);
$httpBackend.expectGET('/static/dashboard/identity/domains/panel.html'). respond({});
$scope.$apply(); $scope.$apply();
var contextArg = deleteModalService.open.calls.argsFor(0)[2]; var contextArg = deleteModalService.open.calls.argsFor(0)[2];
var deleteFunction = contextArg.deleteEntity; var deleteFunction = contextArg.deleteEntity;
deleteFunction(domain.id); deleteFunction(domain.id);
expect(deleteModalService.open).toHaveBeenCalled(); expect(deleteModalService.open).toHaveBeenCalled();
done(); done();
}); });
 End of changes. 4 change blocks. 
2 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)