aboutsummaryrefslogtreecommitdiffstats
path: root/docs/component-spec/versionJumpSpec.js
blob: bb43231a3a8823530e34888b9a7420e3832b772f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
describe('DocsApp', function() {

  // Do not run this suite on Internet Explorer.
  if (msie < 10) return;

  beforeEach(module('docsApp'));

  describe('DocsVersionsCtrl', function() {
    var $scope, ctrl, window, version = '9.8.7';

    beforeEach(function() {
      module(function($provide) {
        $provide.value('$window', window = createMockWindow());
      });
      inject(function($controller, $rootScope) {
        $scope = $rootScope.$new();
        $scope.version = version;
        ctrl = $controller('DocsVersionsCtrl',{
          $scope : $scope,
          $window : window
        });
      });
    });

    describe('changing the URL', function() {
      it('should jump to the url provided', function() {
        $scope.jumpToDocsVersion({ version: '1.0.1', url : 'page123'});
        expect(window.location).toBe('page123');
      });
    });
  });

});