Skip to content

Commit

Permalink
Fix broken tests.
Browse files Browse the repository at this point in the history
Tests were broken prior to the angular-bootstrap update
  • Loading branch information
Daniel Smith committed Feb 15, 2016
1 parent 2fb9c9d commit f16dc1a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
48 changes: 24 additions & 24 deletions tests/dialogs-controllers.tests.js
@@ -1,12 +1,12 @@
describe('Module dialogs.controllers', function(){

var $modalInstance;
var $uibModalInstance;
var $translate;

beforeEach(function(){
module('dialogs.controllers');

$modalInstance = {
$uibModalInstance = {
close: function(arg){},
dismiss: function(arg){}
};
Expand Down Expand Up @@ -49,7 +49,7 @@ describe('Module dialogs.controllers', function(){
$scope = $rootScope.$new();
$rootScope = $rootScope;

spyOn($modalInstance, 'close');
spyOn($uibModalInstance, 'close');
spyOn($scope, '$destroy');

});
Expand All @@ -61,15 +61,15 @@ describe('Module dialogs.controllers', function(){

$ctrlr('errorDialogCtrl', {
$scope: $scope,
$modalInstance: $modalInstance,
$uibModalInstance: $uibModalInstance,
$translate: $translate,
data: data
});
});

it('should close modalInstance when close method executed', function(){
it('should close uibModalInstance when close method executed', function(){
$scope.close();
expect($modalInstance.close).toHaveBeenCalled();
expect($uibModalInstance.close).toHaveBeenCalled();
expect($scope.$destroy).toHaveBeenCalled();
});

Expand Down Expand Up @@ -99,7 +99,7 @@ describe('Module dialogs.controllers', function(){

$ctrlr('errorDialogCtrl', {
$scope: $scope,
$modalInstance: $modalInstance,
$uibModalInstance: $uibModalInstance,
$translate: $translate,
data: data
});
Expand Down Expand Up @@ -135,7 +135,7 @@ describe('Module dialogs.controllers', function(){
$scope = $rootScope.$new();
$rootScope = $rootScope;

spyOn($modalInstance, 'close');
spyOn($uibModalInstance, 'close');
spyOn($scope, '$destroy');

});
Expand All @@ -147,15 +147,15 @@ describe('Module dialogs.controllers', function(){

$ctrlr('notifyDialogCtrl', {
$scope: $scope,
$modalInstance: $modalInstance,
$uibModalInstance: $uibModalInstance,
$translate: $translate,
data: data
});
});

it('should close modalInstance when close method executed', function(){
it('should close uibModalInstance when close method executed', function(){
$scope.close();
expect($modalInstance.close).toHaveBeenCalled();
expect($uibModalInstance.close).toHaveBeenCalled();
expect($scope.$destroy).toHaveBeenCalled();
});

Expand Down Expand Up @@ -185,7 +185,7 @@ describe('Module dialogs.controllers', function(){

$ctrlr('notifyDialogCtrl', {
$scope: $scope,
$modalInstance: $modalInstance,
$uibModalInstance: $uibModalInstance,
$translate: $translate,
data: data
});
Expand Down Expand Up @@ -221,9 +221,9 @@ describe('Module dialogs.controllers', function(){
$scope = $rootScope.$new();
$rootScope = $rootScope;

spyOn($modalInstance, 'close');
spyOn($uibModalInstance, 'close');
spyOn($scope, '$destroy');
spyOn($modalInstance, 'dismiss');
spyOn($uibModalInstance, 'dismiss');

});
});
Expand All @@ -234,20 +234,20 @@ describe('Module dialogs.controllers', function(){

$ctrlr('confirmDialogCtrl', {
$scope: $scope,
$modalInstance: $modalInstance,
$uibModalInstance: $uibModalInstance,
$translate: $translate,
data: data
});
});

it('should dismiss modalInstance when no method executed', function(){
it('should dismiss uibModalInstance when no method executed', function(){
$scope.no();
expect($modalInstance.dismiss).toHaveBeenCalledWith('no');
expect($uibModalInstance.dismiss).toHaveBeenCalledWith('no');
});

it('should close modalInstance when yes method executed', function(){
it('should close uibModalInstance when yes method executed', function(){
$scope.yes();
expect($modalInstance.close).toHaveBeenCalledWith('yes');
expect($uibModalInstance.close).toHaveBeenCalledWith('yes');
});

it('should have default values for header', function(){
Expand Down Expand Up @@ -276,7 +276,7 @@ describe('Module dialogs.controllers', function(){

$ctrlr('confirmDialogCtrl', {
$scope: $scope,
$modalInstance: $modalInstance,
$uibModalInstance: $uibModalInstance,
$translate: $translate,
data: data
});
Expand Down Expand Up @@ -312,7 +312,7 @@ describe('Module dialogs.controllers', function(){
$scope = _$rootScope_.$new();
$rootScope = _$rootScope_;

spyOn($modalInstance, 'close');
spyOn($uibModalInstance, 'close');
spyOn($scope, '$destroy');

});
Expand All @@ -322,7 +322,7 @@ describe('Module dialogs.controllers', function(){
beforeEach(function(){
$ctrlr('waitDialogCtrl', {
$scope: $scope,
$modalInstance: $modalInstance,
$uibModalInstance: $uibModalInstance,
$translate: $translate,
data: {}
});
Expand All @@ -342,7 +342,7 @@ describe('Module dialogs.controllers', function(){

$ctrlr('waitDialogCtrl', {
$scope: $scope,
$modalInstance: $modalInstance,
$uibModalInstance: $uibModalInstance,
$translate: $translate,
data: data
});
Expand Down Expand Up @@ -374,7 +374,7 @@ describe('Module dialogs.controllers', function(){

$ctrlr('waitDialogCtrl', {
$scope: $scope,
$modalInstance: $modalInstance,
$uibModalInstance: $uibModalInstance,
$translate: $translate,
data: data
});
Expand Down
2 changes: 1 addition & 1 deletion tests/dialogs-services.tests.js
Expand Up @@ -81,7 +81,7 @@ describe('Module dialogs.services', function(){
);

expect($modal.open).toHaveBeenCalled();
expect($modal.open).toHaveBeenCalledWith(createModalOptions);
expect($modal.open).toHaveBeenCalledWith(jasmine.objectContaining(createModalOptions));
}));

it('should open modal with backdrop value from useBackdrop config', inject(function($modal){
Expand Down

0 comments on commit f16dc1a

Please sign in to comment.