diff options
Diffstat (limited to 'docs/component-spec')
| -rw-r--r-- | docs/component-spec/NavigationCtrlSpec.js | 72 | ||||
| -rw-r--r-- | docs/component-spec/annotationsSpec.js | 195 | ||||
| -rw-r--r-- | docs/component-spec/bootstrap/bootstrapSpec.js | 157 | ||||
| -rw-r--r-- | docs/component-spec/bootstrap/code.html | 91 | ||||
| -rw-r--r-- | docs/component-spec/docsSearchSpec.js | 53 | ||||
| -rw-r--r-- | docs/component-spec/errorDisplaySpec.js | 76 | ||||
| -rw-r--r-- | docs/component-spec/errorLinkFilterSpec.js | 52 | ||||
| -rw-r--r-- | docs/component-spec/mocks.js | 32 | ||||
| -rw-r--r-- | docs/component-spec/syntaxSpec.js | 50 | ||||
| -rw-r--r-- | docs/component-spec/versionJumpSpec.js | 33 | 
10 files changed, 0 insertions, 811 deletions
| diff --git a/docs/component-spec/NavigationCtrlSpec.js b/docs/component-spec/NavigationCtrlSpec.js deleted file mode 100644 index d7a9da45..00000000 --- a/docs/component-spec/NavigationCtrlSpec.js +++ /dev/null @@ -1,72 +0,0 @@ -describe("DocsNavigationCtrl", function() { - -  beforeEach(module('docsApp')); - -  var ctrl, $scope; - -  beforeEach(function() { -    module(function($provide) { -      $provide.value('docsPages', []); -      $provide.factory('docsSearch', function() { -        return function(q) { -          return ['one','two','three']; -        }; -      }); -    }); -    inject(function($controller, $rootScope, $location, docsSearch) { -      $scope = $rootScope.$new(); -      ctrl = $controller('DocsNavigationCtrl', { -        $scope : $scope, -        $location : $location, -        docsSearch : docsSearch -      }); -    }); -  }); - -  it("should search and return data from docsSearch", function() { -    $scope.search('1234') -    expect($scope.results.join(',')).toBe('one,two,three'); -    expect($scope.hasResults).toBe(true); -  }); - -  it("should avoid searching if the search term is too short", function() { -    $scope.search('1') -    expect($scope.results.length).toBe(0); -    expect($scope.hasResults).toBe(false); -  }); - -  it("should set the columns classname based on the total grouped results", function() { -    $scope.search('1234'); -    expect($scope.colClassName).toBe('cols-3'); - -    $scope.search('1'); -    expect($scope.colClassName).toBe(null); -  }); - -  it("should hide and clear the results when called", function() { -    $scope.hasResults = true; -    $scope.results = ['one']; -    $scope.colClassName = '...'; -    $scope.hideResults(); -    expect($scope.hasResults).toBe(false); -    expect($scope.results.length).toBe(0); -    expect($scope.colClassName).toBe(null); -  }); - -  it("should hide, clear and change the path of the page when submitted", inject(function($location) { -    $scope.hasResults = true; -    $scope.results = { -      api : [ -        {url : '/home'} -      ], -      tutorial : [ -        {url : '/tutorial'} -      ] -    }; -    $scope.submit(); -    expect($location.path()).toBe('/home'); -    expect($scope.results.length).toBe(0); -    expect($scope.hasResults).toBe(false); -  })); - -}); diff --git a/docs/component-spec/annotationsSpec.js b/docs/component-spec/annotationsSpec.js deleted file mode 100644 index 60b17d9a..00000000 --- a/docs/component-spec/annotationsSpec.js +++ /dev/null @@ -1,195 +0,0 @@ -describe('Docs Annotations', function() { - -  beforeEach(module('docsApp')); - -  var body; -  beforeEach(function() { -    body = angular.element(document.body); -    body.empty(); -  }); - -  var normalizeHtml = function(html) { -    return html.toLowerCase().replace(/\s*$/, ''); -  }; - -  describe('popover directive', function() { - -    var $scope, element; -    beforeEach(inject(function($rootScope, $compile) { -      $scope = $rootScope.$new(); -      element = angular.element( -        '<div style="margin:200px;" data-title="title_text" data-content="content_text" popover></div>' -      ); -      element.attr('id','idx'); -      body.append(element); -      $compile(element)($scope); -      $scope.$apply(); -    })); - -    it('should be hidden by default', inject(function(popoverElement) { -      expect(popoverElement.visible()).toBe(false); -    })); - -    it('should capture the click event and set the title and content and position the tip', inject(function(popoverElement) { -      element.triggerHandler('click'); -      expect(popoverElement.isSituatedAt(element)).toBe(true); -      expect(popoverElement.visible()).toBe(true); -      expect(popoverElement.title()).toBe('title_text'); -      expect(popoverElement.content()).toContain('content_text'); -      expect(popoverElement.besideElement.attr('id')).toBe('idx'); -    })); - -    it('should hide and clear the title and content if the same element is clicked again', inject(function(popoverElement) { -      //show the element -      element.triggerHandler('click'); -      expect(popoverElement.isSituatedAt(element)).toBe(true); - -      //hide the element -      element.triggerHandler('click'); -      expect(popoverElement.isSituatedAt(element)).toBe(false); -      expect(popoverElement.visible()).toBe(false); -      expect(popoverElement.title()).toBe(''); -      expect(popoverElement.content()).toBe(''); -    })); - -    it('should parse markdown content', inject(function(popoverElement, $compile) { -      element = angular.element( -        '<div style="margin:200px;" data-title="#title_text" data-content="#heading" popover></div>' -      ); -      body.append(element); -      $compile(element)($scope); -      $scope.$apply(); -      element.triggerHandler('click'); -      expect(popoverElement.title()).toBe('#title_text'); -      expect(normalizeHtml(popoverElement.content())).toMatch('<h1>heading</h1>'); -    })); - -  }); - - -  describe('foldout directive', function() { - -    // Do not run this suite on Internet Explorer. -    if (msie < 10) return; - -    var $scope, parent, element, url; -    beforeEach(function() { -      module(function($provide, $animateProvider) { -        $animateProvider.register('.foldout', function($timeout) { -          return { -            enter : function(element, done) { -              $timeout(done, 1000); -            }, -            removeClass : function(element, className, done) { -              $timeout(done, 500); -            }, -            addClass : function(element, className, done) { -              $timeout(done, 200); -            } -          } -        }); -      }); -      inject(function($rootScope, $compile, $templateCache, $rootElement, $animate) { -        $animate.enabled(true); -        url = '/page.html'; -        $scope = $rootScope.$new(); -        parent = angular.element('<div class="parent"></div>'); - -        //we're injecting the element to the $rootElement since the changes in -        //$animate only detect and perform animations if the root element has -        //animations enabled. If the element is not apart of the DOM -        //then animations are skipped. -        element = angular.element('<div data-url="' + url + '" class="foldout" foldout></div>'); -        parent.append(element); -        $rootElement.append(parent); -        body.append($rootElement); - -        $compile(parent)($scope); -        $scope.$apply(); -      }); -    }); - -    it('should inform that it is loading', inject(function($httpBackend) { -      $httpBackend.expect('GET', url).respond('hello'); -      element.triggerHandler('click'); - -      var kids = body.children(); -      var foldout = angular.element(kids[kids.length-1]); -      expect(foldout.html()).toContain('loading'); -    })); - -    //TODO(matias): this test is bad. it's not clear what is being tested and what the assertions are. -    //    Additionally, now that promises get auto-flushed there are extra tasks in the deferred queue which screws up -    //    these brittle tests. -    xit('should download a foldout HTML page and animate the contents', inject(function($httpBackend, $timeout, $sniffer) { -      $httpBackend.expect('GET', url).respond('hello'); - -      element.triggerHandler('click'); -      $httpBackend.flush(); - -      $timeout.flushNext(0); -      $timeout.flushNext(1000); - -      var kids = body.children(); -      var foldout = angular.element(kids[kids.length-1]); -      expect(foldout.text()).toContain('hello'); -    })); - -    //TODO(matias): this test is bad. it's not clear what is being tested and what the assertions are. -    //    Additionally, now that promises get auto-flushed there are extra tasks in the deferred queue which screws up -    //    these brittle tests. -    xit('should hide then show when clicked again', inject(function($httpBackend, $timeout, $sniffer) { -      $httpBackend.expect('GET', url).respond('hello'); - -      //enter -      element.triggerHandler('click'); -      $httpBackend.flush(); -      $timeout.flushNext(0); -      $timeout.flushNext(1000); - -      //hide -      element.triggerHandler('click'); -      $timeout.flushNext(0); -      $timeout.flushNext(200); - -      //show -      element.triggerHandler('click'); -      $timeout.flushNext(0); -      $timeout.flushNext(500); -      $timeout.flushNext(0); -    })); - -  }); - -  describe('DocsController fold', function() { - -    var $scope, ctrl; -    beforeEach(function() { -      inject(function($rootScope, $controller, $location, $cookies, sections) { -        $scope = $rootScope.$new(); -        ctrl = $controller('DocsController',{ -          $scope : $scope, -          $location : $location, -          $cookies : $cookies, -          sections : sections -        }); -      }); -    }); - -    it('should download and reveal the foldover container', inject(function($compile, $httpBackend) { -      var url = '/page.html'; -      var fullUrl = '/notes/' + url; -      $httpBackend.expect('GET', fullUrl).respond('hello'); - -      var element = angular.element('<div ng-include="docs_fold"></div>'); -      $compile(element)($scope); -      $scope.$apply(); - -      $scope.fold(url); - -      $httpBackend.flush(); -    })); - -  }); - -}); diff --git a/docs/component-spec/bootstrap/bootstrapSpec.js b/docs/component-spec/bootstrap/bootstrapSpec.js deleted file mode 100644 index 2c8d89fa..00000000 --- a/docs/component-spec/bootstrap/bootstrapSpec.js +++ /dev/null @@ -1,157 +0,0 @@ -'use strict'; - -describe('bootstrap', function() { -  var $compile, $rootScope, element; - -  function clickTab(element, index) { -    browserTrigger(element.children().eq(0).children().eq(index)); -  } - -  beforeEach(module('bootstrap')); -  beforeEach(inject(function(_$compile_, _$rootScope_) { -    $compile = _$compile_; -    $rootScope = _$rootScope_; -  })); -  beforeEach(function(){ -    function findTab(element, index) { -      return _jQuery(element[0]).find('> .nav-tabs > li').eq(index); -    } -    function findTabPane(element, index) { -      return _jQuery(element[0]).find('> .tab-content > .tab-pane').eq(index); -    } - -    this.addMatchers({ -      toHaveTab: function(index, title) { -        var tab = findTab(element, index); - -        this.message = function() { -          if (tab.length) { -            return 'Expect tab index ' + index + ' to be ' + toJson(title) + ' but was ' + toJson(tab.text()); -          } else { -            return 'Expect tab index ' + index + ' to be ' + toJson(title) + ' but there are only ' + -              element.children().length + ' tabs.'; -          } -        }; - -        return tab.length && tab.text() == title; -      }, - -      toHaveTabPane: function(index, title) { -        var tabPane = findTabPane(element, index); - -        this.message = function() { -          if (tabPane.length) { -            return 'Expect tab pane index ' + index + ' to be ' + toJson(title) + ' but was ' + toJson(tabPane.text()); -          } else { -            return 'Expect tab pane index ' + index + ' to be ' + toJson(title) + ' but there are only ' + -              element.children().length + 'tab panes.'; -          } -        }; - -        return tabPane.length && tabPane.text() == title; -      }, - -      toHaveSelected: function(index) { -        var tab = findTab(element, index); -        var tabPane = findTabPane(element, index); - -        this.message = function() { -          return 'Expect tab  index ' + index + ' to be selected\n' + -            '     TAB: ' + angular.mock.dump(tab) + '\n' + -            'TAB-PANE: ' + angular.mock.dump(tabPane); -        }; - -        return tabPane.hasClass('active') && tab.hasClass('active'); -      } -    }); -  }); - -  afterEach(function() { -    dealoc(element); -  }); - -  describe('tabbable', function() { - -    it('should create the right structure', function() { -      element = $compile( -        '<div class="tabbable">' + -          '<div class="tab-pane" title="first">tab1</div>' + -          '<div class="tab-pane" title="second">tab2</div>' + -        '</div>')($rootScope); - -      $rootScope.$apply(); - -      expect(element).toHaveTab(0, 'first'); -      expect(element).toHaveTab(1, 'second'); - -      expect(element).toHaveTabPane(0, 'tab1'); -      expect(element).toHaveTabPane(1, 'tab2'); - -      expect(element).toHaveSelected(0); -    }); - - -    it('should respond to tab click', function(){ -      element = $compile( -        '<div class="tabbable">' + -          '<div class="tab-pane" title="first">tab1</div>' + -          '<div class="tab-pane" title="second">tab2</div>' + -          '</div>')($rootScope); - -      expect(element).toHaveSelected(0); -      clickTab(element, 1); -      expect(element).toHaveSelected(1); -    }); - - -    it('should select the first tab in repeater', function() { -      element = $compile( -        '<div class="tabbable">' + -          '<div class="tab-pane" ng-repeat="id in [1,2,3]" title="Tab {{id}}" value="tab-{{id}}">' + -          'Tab content {{id}}!' + -          '</div>' + -        '</div>')($rootScope); -      $rootScope.$apply(); - -      expect(element).toHaveSelected(0); -    }); - - -    describe('ngModel', function() { -      it('should bind to model', function() { -        $rootScope.tab = 'B'; - -        element = $compile( -          '<div class="tabbable" ng-model="tab">' + -            '<div class="tab-pane" title="first" value="A">tab1</div>' + -            '<div class="tab-pane" title="second" value="B">tab2</div>' + -          '</div>')($rootScope); - -        $rootScope.$apply(); -        expect(element).toHaveSelected(1); - -        $rootScope.tab = 'A'; -        $rootScope.$apply(); -        expect(element).toHaveSelected(0); - -        clickTab(element, 1); -        expect($rootScope.tab).toEqual('B'); -        expect(element).toHaveSelected(1); -      }); - - -      it('should not overwrite the model', function() { -        $rootScope.tab = 'tab-2'; -        element = $compile( -        '<div class="tabbable" ng-model="tab">' + -            '<div class="tab-pane" ng-repeat="id in [1,2,3]" title="Tab {{id}}" value="tab-{{id}}">' + -            'Tab content {{id}}!' + -            '</div>' + -            '</div>')($rootScope); -        $rootScope.$apply(); - -        expect(element).toHaveSelected(1); -      }); -    }); -  }); -}); diff --git a/docs/component-spec/bootstrap/code.html b/docs/component-spec/bootstrap/code.html deleted file mode 100644 index e1eaa8d2..00000000 --- a/docs/component-spec/bootstrap/code.html +++ /dev/null @@ -1,91 +0,0 @@ -<!doctype html> -<html> -  <head> -    <script src="../../src/angular-bootstrap.js"></script> -    <script type="text/javascript"> -      $script('src/bootstrap/google-prettify/prettify', 'prettify'); -      $script.ready('angular', function() { -        $script(['src/bootstrap/bootstrap-prettify', 'src/bootstrap/bootstrap'], 'myCode'); -        angular.module('myApp', []).run(function($rootScope){ $rootScope.text = 'WORKS!' }); -      }); -      $script.ready(['myCode', 'prettify'], function() { -        angular.bootstrap(document, ['bootstrapPrettify', 'bootstrap']); -      }); -    </script> -    <link rel="stylesheet" href="../../src/bootstrap/google-prettify/prettify.css" type="text/css"> -    <link rel="stylesheet" href="../../src/bootstrap/css/bootstrap.css" type="text/css"> -  </head> -  <body> -    <div class="container"> -      <div class="row"> -        <div class="span12"> -          <h1>AngularJS is {{'working'}}</h1> - -          <h2>Directive: <code>prettify</code></h2> -          <pre class="prettyprint linenums"> -            <p>Sample text here...</p> -          </pre> - - -          <h2>Directive: <code>ng-set-text</code></h2> -          <pre class="prettyprint linenums" ng-set-text="hello.html"></pre> -          <script type="text/html" id="hello.html"> -            <h1>Hello World!</h1> -          </script> - -          <h2>Directive: <code>ng-html-wrap</code></h2> -          <pre class="prettyprint linenums" ng-set-text="hello.html" ng-html-wrap="angular.js angular-resource.js myApp abc.js abc.css"></pre> - -          <h2>Directive <code>ng-embed-app</code></h2> -          <div ng-embed-app="myApp">{{text}}</div> - -          <h1>Bootstrap</h1> - -          <h2>Directive <code>drop-down-toggle</code></h2> -          <div class="btn btn-primary dropdown"> -            <a href="#ABC" class="dropdown-toggle"> -              Account -              <b class="caret"></b> -            </a> -            <ul class="dropdown-menu"> -              <li>One</li> -              <li>Two</li> -            </ul> -          </div> - -          <h2 ng-init="state = 'tab-2' ">Directive <code>tabbable</code></h2> -          state = {{state}} - -          <div class="tabbable" ng-model="state"> -            <div class="tab-pane" ng-repeat="id in [1,2,3]" title="Tab {{id}}" value='tab-{{id}}'> -              Tab content {{id}}! -            </div> -          </div> - -          <hr/> - -          <div class="tabbable" ng-model="state"> -            <div class="tab-pane" ng-repeat="id in [1,2,3]" title="Tab {{id}}" value='tab-{{id}}'> -              Tab content {{id}}! -            </div> -          </div> - -          <hr/> - -          <div class="tabbable"> -            <div class="tab-pane" ng-repeat="id in [1,2,3]" title="Tab {{id}}" value='tab-{{id}}'> -              Tab content {{id}}! -            </div> -          </div> - -        </div> -      </div> -    </div> -    <br/> -    <br/> -    <br/> -    <br/> -    <br/> -    <br/> -  </body> -</html> diff --git a/docs/component-spec/docsSearchSpec.js b/docs/component-spec/docsSearchSpec.js deleted file mode 100644 index f5f8d36e..00000000 --- a/docs/component-spec/docsSearchSpec.js +++ /dev/null @@ -1,53 +0,0 @@ -describe("docsSearch", function() { - -  beforeEach(module('docsApp')); - -  var interceptedLunrResults; -  beforeEach(function() { -    interceptedLunrResults = []; -  }); - -  beforeEach(function() { -    module(function($provide) { -      var results = []; -      results[0] = { section: 'tutorial', shortName: 'item one', keywords: 'item, one, 1' }; -      results[1] = { section: 'tutorial', shortName: 'item man', keywords: 'item, man' }; -      results[2] = { section: 'api', shortName: 'item other', keywords: 'item, other' }; -      results[3] = { section: 'api', shortName: 'ngRepeat', keywords: 'item, other' }; - -      $provide.value('NG_PAGES', results); -      $provide.factory('lunrSearch', function() { -        return function() { -          return { -            store : function(value) { -              interceptedLunrResults.push(value); -            }, -            search : function(q) { -              var data = []; -              angular.forEach(results, function(res, i) { -                data.push({ ref : i }); -              }); -              return data; -            } -          }  -        }; -      }); -    }); -  }); - -  it("should lookup and organize values properly", inject(function(docsSearch) { -    var items = docsSearch('item'); -    expect(items['api'].length).toBe(2); -  })); - -  it("should return all results without a search", inject(function(docsSearch) { -    var items = docsSearch(); -    expect(items['tutorial'].length).toBe(2); -    expect(items['api'].length).toBe(2); -  })); - -  it("should store values with and without a ng prefix", inject(function(docsSearch) { -    expect(interceptedLunrResults[3].title).toBe('ngRepeat repeat'); -  })); - -}); diff --git a/docs/component-spec/errorDisplaySpec.js b/docs/component-spec/errorDisplaySpec.js deleted file mode 100644 index 9549e220..00000000 --- a/docs/component-spec/errorDisplaySpec.js +++ /dev/null @@ -1,76 +0,0 @@ -describe("errorDisplay", function () { - -  var $location, compileHTML; - -  beforeEach(module('docsApp')); - -  beforeEach(inject(function ($injector) { -    var $rootScope = $injector.get('$rootScope'), -      $compile = $injector.get('$compile'); - -    $location = $injector.get('$location'); - -    compileHTML = function (code) { -      var elm = angular.element(code); -      $compile(elm)($rootScope); -      $rootScope.$digest(); -      return elm; -    }; - -    this.addMatchers({ -      toInterpolateTo: function (expected) { -        // Given a compiled DOM node with a minerr-display attribute, -        // assert that its interpolated string matches the expected text. -        return this.actual.text() === expected; -      } -    }); -  })); - -  it('should interpolate a template with no parameters', function () { -    var elm; - -    spyOn($location, 'search').andReturn({}); -    elm = compileHTML('<div error-display="This is a test"></div>'); -    expect(elm).toInterpolateTo('This is a test'); -  }); - -  it('should interpolate a template with no parameters when search parameters are present', function () { -    var elm; - -    spyOn($location, 'search').andReturn({ p0: 'foobaz' }); -    elm = compileHTML('<div error-display="This is a test"></div>'); -    expect(elm).toInterpolateTo('This is a test'); -  }); - -  it('should correctly interpolate search parameters', function () { -    var elm; - -    spyOn($location, 'search').andReturn({ p0: '42' }); -    elm = compileHTML('<div error-display="The answer is {0}"></div>'); -    expect(elm).toInterpolateTo('The answer is 42'); -  }); - -  it('should interpolate parameters in the specified order', function () { -    var elm; - -    spyOn($location, 'search').andReturn({ p0: 'second', p1: 'first' }); -    elm = compileHTML('<div error-display="{1} {0}"></div>'); -    expect(elm).toInterpolateTo('first second'); -  }); - -  it('should preserve interpolation markers when fewer arguments than needed are provided', function () { -    var elm; - -    spyOn($location, 'search').andReturn({ p0: 'Fooooo' }); -    elm = compileHTML('<div error-display="This {0} is {1} on {2}"></div>'); -    expect(elm).toInterpolateTo('This Fooooo is {1} on {2}'); -  }); - -  it('should correctly handle the empty string as an interpolation parameter', function () { -    var elm; - -    spyOn($location, 'search').andReturn({ p0: 'test', p1: '' }); -    elm = compileHTML('<div error-display="This {0} is a {1}"></div>'); -    expect(elm).toInterpolateTo('This test is a '); -  }); -});
\ No newline at end of file diff --git a/docs/component-spec/errorLinkFilterSpec.js b/docs/component-spec/errorLinkFilterSpec.js deleted file mode 100644 index 1b3cbf73..00000000 --- a/docs/component-spec/errorLinkFilterSpec.js +++ /dev/null @@ -1,52 +0,0 @@ -describe("errorLinkFilter", function () { - -  var errorLinkFilter; - -  beforeEach(module('docsApp')); - -  beforeEach(inject(function ($filter) { -    errorLinkFilter = $filter('errorLink'); -  })); - -  it('should not change text that does not contain links', function () { -    expect(errorLinkFilter('This is a test')).toBe('This is a test'); -  }); - -  it('should find links in text and linkify them', function () { -    var output = errorLinkFilter("http://ab/ (http://a/) http://1.2/v:~-123. c"); -    //temporary fix for IE8 sanitization whitespace bug -    output = output.replace('</a>(','</a> ('); -    expect(output). -      toBe('<a href="http://ab/">http://ab/</a> ' + -              '(<a href="http://a/">http://a/</a>) ' + -              '<a href="http://1.2/v:~-123">http://1.2/v:~-123</a>. c'); -    expect(errorLinkFilter(undefined)).not.toBeDefined(); -  }); - -  it('should handle mailto', function () { -    expect(errorLinkFilter("mailto:me@example.com")). -      toBe('<a href="mailto:me@example.com">me@example.com</a>'); -    expect(errorLinkFilter("me@example.com")). -      toBe('<a href="mailto:me@example.com">me@example.com</a>'); -    expect(errorLinkFilter("send email to me@example.com, but")). -      toBe('send email to <a href="mailto:me@example.com">me@example.com</a>, but'); -  }); - -  it('should handle target', function () { -    expect(errorLinkFilter("http://example.com", "_blank")). -      toBe('<a target="_blank" href="http://example.com">http://example.com</a>') -    expect(errorLinkFilter("http://example.com", "someNamedIFrame")). -      toBe('<a target="someNamedIFrame" href="http://example.com">http://example.com</a>') -  }); - -  it('should not linkify stack trace URLs', function () { -    expect(errorLinkFilter("http://example.com/angular.min.js:42:1337")). -      toBe("http://example.com/angular.min.js:42:1337"); -  }); - -  it('should truncate linked URLs at 60 characters', function () { -    expect(errorLinkFilter("http://errors.angularjs.org/very-long-version-string/$injector/nomod?p0=myApp")). -      toBe('<a href="http://errors.angularjs.org/very-long-version-string/$injector/nomod?p0=myApp">' + -        'http://errors.angularjs.org/very-long-version-string/$inj...</a>'); -  }); -}); diff --git a/docs/component-spec/mocks.js b/docs/component-spec/mocks.js deleted file mode 100644 index f916c0ed..00000000 --- a/docs/component-spec/mocks.js +++ /dev/null @@ -1,32 +0,0 @@ -// Copy/pasted from src/Angular.js, so that we can disable specific tests on IE. -var msie = parseInt((/msie (\d+)/.exec(navigator.userAgent.toLowerCase()) || [])[1], 10); - -var createMockWindow = function() { -  var mockWindow = {}; -  var setTimeoutQueue = []; - -  mockWindow.location = window.location; -  mockWindow.document = window.document; -  mockWindow.getComputedStyle = angular.bind(window, window.getComputedStyle); -  mockWindow.scrollTo = angular.bind(window, window.scrollTo); -  mockWindow.navigator = window.navigator; -  mockWindow.setTimeout = function(fn, delay) { -    setTimeoutQueue.push({fn: fn, delay: delay}); -  }; -  mockWindow.setTimeout.queue = setTimeoutQueue; -  mockWindow.setTimeout.expect = function(delay) { -    if (setTimeoutQueue.length > 0) { -      return { -        process: function() { -          var tick = setTimeoutQueue.shift(); -          expect(tick.delay).toEqual(delay); -          tick.fn(); -        } -      }; -    } else { -      expect('SetTimoutQueue empty. Expecting delay of ').toEqual(delay); -    } -  }; - -  return mockWindow; -}; diff --git a/docs/component-spec/syntaxSpec.js b/docs/component-spec/syntaxSpec.js deleted file mode 100644 index 2868602b..00000000 --- a/docs/component-spec/syntaxSpec.js +++ /dev/null @@ -1,50 +0,0 @@ -describe('Docs Syntax', function() { - -  beforeEach(module('bootstrap')); - -  describe('syntax', function() { - -    var id, element, document; - -    beforeEach(inject(function($compile, $rootScope, $document) { -      document = $document[0]; -      //create the HTML elements missing in IE8 for this directive -      document.createElement('nav'); - -      element = angular.element( -        '<div>' + -          '<pre syntax ' + -            'syntax-github="gh-url" ' + -            'syntax-plunkr="pl-url" ' + -            'syntax-fiddle="jf-url">' + -          '</pre>' + -        '</div>' -      ); -      $compile(element)($rootScope); -      $rootScope.$digest(); - -      element = element[0]; -      document.body.appendChild(element); -    })); - -    it("should properly prepare a github link in the page", function() { -      var github = element.querySelector('.syntax-github'); -      expect(github.innerHTML).toMatch(/View on Github/i); -      expect(github.getAttribute('href')).toBe('gh-url'); -    }); - -    it("should properly prepare a plunkr link in the page", function() { -      var plunkr = element.querySelector('.syntax-plunkr'); -      expect(plunkr.innerHTML).toMatch(/View on Plunkr/i); -      expect(plunkr.getAttribute('href')).toBe('pl-url'); -    }); - -    it("should properly prepare a jsfiddle link in the page", function() { -      var jsfiddle = element.querySelector('.syntax-jsfiddle'); -      expect(jsfiddle.innerHTML).toMatch(/View on JSFiddle/i); -      expect(jsfiddle.getAttribute('href')).toBe('jf-url'); -    }); - -  }); - -}); diff --git a/docs/component-spec/versionJumpSpec.js b/docs/component-spec/versionJumpSpec.js deleted file mode 100644 index bb43231a..00000000 --- a/docs/component-spec/versionJumpSpec.js +++ /dev/null @@ -1,33 +0,0 @@ -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'); -      }); -    }); -  }); - -}); | 
