EDIT : Quick & Dirty solution at the end of this post
I am using a modal window from AngularUI-Bootstrap in the same way that it is explained on
Instead of:
modalInstance = { // Create a mock object using spies
close: jasmine.createSpy('modalInstance.close'),
dismiss: jasmine.createSpy('modalInstance.dismiss'),
result: {
then: jasmine.createSpy('modalInstance.result.then')
}
};
This can be written as:
modalInstance = jasmine.createSpyObj('modalInstance', ['close', 'dismiss', 'result.then']);
Also there is no $modalInstance it is now $uibModalInstance so every "modalInstance" above should be replaced with "uibModalInstance"