@@ -7,21 +7,6 @@ describe('DocsApp', function() {
77
88 beforeEach ( function ( ) {
99 module ( function ( $provide ) {
10- $provide . value ( 'NG_VERSIONS' , [
11- '1.0.0' ,
12- '1.0.1' ,
13- '1.0.2' ,
14- '1.0.3' ,
15- '1.0.4' ,
16- '1.0.5' ,
17- '1.0.6' ,
18- '1.1.0' ,
19- '1.1.1' ,
20- '1.1.2' ,
21- '1.1.3' ,
22- '1.1.4' ,
23- '2.1.3'
24- ] ) ;
2510 $provide . value ( '$window' , window = createMockWindow ( ) ) ;
2611 } ) ;
2712 inject ( function ( $controller , $rootScope ) {
@@ -34,91 +19,11 @@ describe('DocsApp', function() {
3419 } ) ;
3520 } ) ;
3621
37- it ( 'should have the correct version of angular' , function ( ) {
38- expect ( version ) . toBe ( $scope . version ) ;
39- } ) ;
40-
41- it ( 'should order versions in decending order' , function ( ) {
42- expect ( $scope . versions . length ) . toBeGreaterThan ( 0 ) ;
43-
44- var one = $scope . versions [ 0 ] . version ;
45- var two = $scope . versions [ 1 ] . version ;
46-
47- expect ( one ) . toBeGreaterThan ( two ) ;
48- } ) ;
49-
50- it ( 'should list unstable versions at the top of the list' , function ( ) {
51- expect ( $scope . versions [ 0 ] . stable ) . toBe ( false ) ;
52- } ) ;
53-
54- it ( 'should list all items below the last stable as stable regardless of version number' , function ( ) {
55- var limit = $scope . versions . length - 1 ,
56- lastUnstableIndex = 0 ;
57-
58- while ( lastUnstableIndex <= limit ) {
59- if ( $scope . versions [ lastUnstableIndex ++ ] . stable ) break ;
60- }
61-
62- for ( var i = lastUnstableIndex ; i <= limit ; i ++ ) {
63- expect ( $scope . versions [ i ] . stable ) . toBe ( true ) ;
64- }
65- } ) ;
66-
6722 describe ( 'changing the URL' , function ( ) {
68- it ( 'should not support the old < 1.0 docs pages' , function ( ) {
69- window . location = 'old' ;
70-
71- $scope . versions . unshift ( {
72- stable : true ,
73- version : '0.9.10'
74- } ) ;
75- $scope . jumpToDocsVersion ( '0.9.10' ) ;
76- expect ( window . location ) . toBe ( 'old' ) ;
77-
78- $scope . versions . unshift ( {
79- stable : true ,
80- version : '0.10.1'
81- } ) ;
82- $scope . jumpToDocsVersion ( '0.10.1' ) ;
83- expect ( window . location ) . toBe ( 'old' ) ;
84-
85- $scope . jumpToDocsVersion ( '2.1.3' ) ;
86- expect ( window . location ) . toBe ( 'http://code.angularjs.org/2.1.3/docs' ) ;
87- } ) ;
88-
89- it ( 'should jump to the older versions of current docs for version >= 1.0.2' , function ( ) {
90- $scope . jumpToDocsVersion ( '1.0.1' ) ;
91- expect ( window . location ) . toBe ( 'http://code.angularjs.org/1.0.1/docs-1.0.1' ) ;
92-
93- $scope . jumpToDocsVersion ( '1.0.2' ) ;
94- expect ( window . location ) . toBe ( 'http://code.angularjs.org/1.0.2/docs' ) ;
95-
96- $scope . jumpToDocsVersion ( '1.1.2' ) ;
97- expect ( window . location ) . toBe ( 'http://code.angularjs.org/1.1.2/docs' ) ;
23+ it ( 'should jump to the url provided' , function ( ) {
24+ $scope . jumpToDocsVersion ( { version : '1.0.1' , url : 'page123' } ) ;
25+ expect ( window . location ) . toBe ( 'page123' ) ;
9826 } ) ;
99-
100- it ( 'should use the current docs.angularjs.org page when the selected version is the last stable version' , function ( ) {
101- $scope . versions = [ {
102- stable : true ,
103- title : 'test' ,
104- version : '1.1.1'
105- } ] ;
106-
107- $scope . jumpToDocsVersion ( '1.1.1' ) ;
108- expect ( window . location ) . toBe ( 'http://docs.angularjs.org' ) ;
109-
110- $scope . versions . unshift ( {
111- stable : true ,
112- title : 'test2' ,
113- version : '1.2.1'
114- } ) ;
115-
116- $scope . jumpToDocsVersion ( '1.1.1' ) ;
117- expect ( window . location ) . toBe ( 'http://code.angularjs.org/1.1.1/docs' ) ;
118- $scope . jumpToDocsVersion ( '1.2.1' ) ;
119- expect ( window . location ) . toBe ( 'http://docs.angularjs.org' ) ;
120- } ) ;
121-
12227 } ) ;
12328 } ) ;
12429
0 commit comments