title: uibModal provider unknown unitTest
body: <p>I'm starting to learn how to do unitTesting with jasmine. I read a lot of in internet and SO but I can't solve my problem.</p>
  
  <p>I have a directive which has a controller. That controller is using the service $uibModal to open a modal when I click an element. I'm trying to inject that service from my test but I can't. I read a lot of threads saying that I must pass an instance. I'm trying to do so but I can't. Please any help will be appreciated.</p>
  
  <pre><code>.controller('myController', ['$scope', '$uibModal', function($scope, $uibModal){
      var self = this;
      //OTHER CODE
      self.openMyModal = function(dataInput) {
          var modalInstance = $uibModal.open({
              animation: true,
              bindToController: true,
              templateUrl: 'app/myComponent/modals/component-modal.html',
              controllerAs: 'componentModalCtrl',
              controller: 'componentModalController',
              windowClass: 'semi-modal semi-modal--large',
              scope: $scope
          })
      }
      //OTHER CODE
  }
  </code></pre>
  
  <p>This is the test where I'm trying to mock this modal.</p>
  
  <pre><code>beforeEach(function(){
      angular.mock.module('templates');
      angular.mock.module('app.components.myComponent');
  
      angular.mock.inject(function($compile, $rootScope, $templateCache, $controller){
          scope = $rootScope;
          modalInstance = { close: function(){}, dismiss: function(){}, open: function(){}
      };
      //Initializing element and doing compile and digest
      controller = $controller('myController', {$scope: scope, $uibModal: modalInstance});
  
  })
  </code></pre>
  
  <p>I'm getting the error </p>
  
  <blockquote>
    <p>Unknown provider: $uibModalProvider &lt;- $uibModal.</p>
  </blockquote>
  
  <p>Can I inject this service in another way? What I'm doing wrong?</p>
  
  <p>P.S: I have read this <a href="https://stackoverflow.com/questions/24373220/testing-angularui-bootstrap-modal-instance-controller/24376344#24376344">Testing AngularUI Bootstrap modal instance controller</a></p>
  
  <p><a href="https://stackoverflow.com/questions/34482810/angular-ui-bootstrap-uibmodalinstance-breaks-down-unit-tests">Angular ui bootstrap $uibModalInstance breaks down unit tests</a></p>
  
  <p><a href="https://stackoverflow.com/questions/21214868/mocking-modal-in-angularjs-unit-tests">Mocking $modal in AngularJS unit tests</a></p>