diff --git a/horizon/karma.conf.js b/horizon/karma.conf.js index 6f0e758c6a..cb8015f45d 100644 --- a/horizon/karma.conf.js +++ b/horizon/karma.conf.js @@ -141,8 +141,7 @@ module.exports = function (config) { client: { jasmine: { - random: false, - failSpecWithNoExpectations: true + random: false } }, diff --git a/openstack_dashboard/dashboards/identity/static/dashboard/identity/domains/actions/delete.service.spec.js b/openstack_dashboard/dashboards/identity/static/dashboard/identity/domains/actions/delete.service.spec.js index 865a7bba60..22b69c4511 100644 --- a/openstack_dashboard/dashboards/identity/static/dashboard/identity/domains/actions/delete.service.spec.js +++ b/openstack_dashboard/dashboards/identity/static/dashboard/identity/domains/actions/delete.service.spec.js @@ -97,12 +97,14 @@ var domain = generateDomains(1)[0]; service.perform(domain); $scope.$apply(); - done(); var contextArg = deleteModalService.open.calls.argsFor(0)[2]; var deleteFunction = contextArg.deleteEntity; deleteFunction(domain.id); + + expect(deleteModalService.open).toHaveBeenCalled(); + done(); }); it('should pass and fail in a function that delete domain by item action', function(done) { @@ -113,12 +115,14 @@ var domain = generateDomains(1)[0]; service.perform(domain); $scope.$apply(); - done(); var contextArg = deleteModalService.open.calls.argsFor(0)[2]; var deleteFunction = contextArg.deleteEntity; deleteFunction(domain.id); + + expect(deleteModalService.open).toHaveBeenCalled(); + done(); }); it('should pass and fail in a function that delete domain by batch action', function(done) { @@ -129,12 +133,14 @@ var domain = generateDomains(1)[0]; service.perform([domain]); $scope.$apply(); - done(); var contextArg = deleteModalService.open.calls.argsFor(0)[2]; var deleteFunction = contextArg.deleteEntity; deleteFunction(domain.id); + + expect(deleteModalService.open).toHaveBeenCalled(); + done(); }); it('fail to policy check because of no privilege', function() { diff --git a/openstack_dashboard/dashboards/identity/static/dashboard/identity/groups/actions/delete.action.service.spec.js b/openstack_dashboard/dashboards/identity/static/dashboard/identity/groups/actions/delete.action.service.spec.js index 233f60c555..a2a31ff580 100644 --- a/openstack_dashboard/dashboards/identity/static/dashboard/identity/groups/actions/delete.action.service.spec.js +++ b/openstack_dashboard/dashboards/identity/static/dashboard/identity/groups/actions/delete.action.service.spec.js @@ -109,12 +109,14 @@ var group = generateItems(1)[0]; service.perform(group); $scope.$apply(); - done(); var contextArg = deleteModalService.open.calls.argsFor(0)[2]; var deleteFunction = contextArg.deleteEntity; deleteFunction(group.id); + + expect(deleteModalService.open).toHaveBeenCalled(); + done(); }); it('should pass and fail in a function that delete group by item action', function(done) { @@ -125,12 +127,14 @@ var group = generateItems(1)[0]; service.perform(group); $scope.$apply(); - done(); var contextArg = deleteModalService.open.calls.argsFor(0)[2]; var deleteFunction = contextArg.deleteEntity; deleteFunction(group.id); + + expect(deleteModalService.open).toHaveBeenCalled(); + done(); }); it('should pass and fail in a function that delete group by batch action', function(done) { @@ -141,12 +145,14 @@ var group = generateItems(1)[0]; service.perform([group]); $scope.$apply(); - done(); var contextArg = deleteModalService.open.calls.argsFor(0)[2]; var deleteFunction = contextArg.deleteEntity; deleteFunction(group.id); + + expect(deleteModalService.open).toHaveBeenCalled(); + done(); }); it('should call policy check', function() { diff --git a/openstack_dashboard/dashboards/identity/static/dashboard/identity/users/actions/delete.action.service.spec.js b/openstack_dashboard/dashboards/identity/static/dashboard/identity/users/actions/delete.action.service.spec.js index 708051012a..aeacec07b2 100644 --- a/openstack_dashboard/dashboards/identity/static/dashboard/identity/users/actions/delete.action.service.spec.js +++ b/openstack_dashboard/dashboards/identity/static/dashboard/identity/users/actions/delete.action.service.spec.js @@ -98,12 +98,14 @@ var user = generateItems(1)[0]; service.perform(user); $scope.$apply(); - done(); var contextArg = deleteModalService.open.calls.argsFor(0)[2]; var deleteFunction = contextArg.deleteEntity; deleteFunction(user.id); + + expect(deleteModalService.open).toHaveBeenCalled(); + done(); }); it('should pass and fail in a function that delete user by item action', function(done) { @@ -114,12 +116,14 @@ var user = generateItems(1)[0]; service.perform(user); $scope.$apply(); - done(); var contextArg = deleteModalService.open.calls.argsFor(0)[2]; var deleteFunction = contextArg.deleteEntity; deleteFunction(user.id); + + expect(deleteModalService.open).toHaveBeenCalled(); + done(); }); it('should pass and fail in a function that delete user by batch action', function(done) { @@ -130,12 +134,14 @@ var user = generateItems(1)[0]; service.perform([user]); $scope.$apply(); - done(); var contextArg = deleteModalService.open.calls.argsFor(0)[2]; var deleteFunction = contextArg.deleteEntity; deleteFunction(user.id); + + expect(deleteModalService.open).toHaveBeenCalled(); + done(); }); it('should call policy check', function() { diff --git a/openstack_dashboard/karma.conf.js b/openstack_dashboard/karma.conf.js index d542b82e00..4d1168c733 100644 --- a/openstack_dashboard/karma.conf.js +++ b/openstack_dashboard/karma.conf.js @@ -180,11 +180,9 @@ module.exports = function (config) { dir: '../cover/openstack_dashboard' }, - // TODO(tmazur) set failSpecWithNoExpectations to true after fixing tests client: { jasmine: { - random: false, - failSpecWithNoExpectations: false + random: false } },