1
1
describe ( '$modal' , function ( ) {
2
2
var $controllerProvider , $rootScope , $document , $compile , $templateCache , $timeout , $q ;
3
- var $modal , $modalProvider ;
3
+ var $modal , $modalStack , $ modalProvider;
4
4
5
5
var triggerKeyDown = function ( element , keyCode ) {
6
6
var e = $ . Event ( 'keydown' ) ;
@@ -16,14 +16,15 @@ describe('$modal', function () {
16
16
$modalProvider = _$modalProvider_ ;
17
17
} ) ) ;
18
18
19
- beforeEach ( inject ( function ( _$rootScope_ , _$document_ , _$compile_ , _$templateCache_ , _$timeout_ , _$q_ , _$modal_ ) {
19
+ beforeEach ( inject ( function ( _$rootScope_ , _$document_ , _$compile_ , _$templateCache_ , _$timeout_ , _$q_ , _$modal_ , _$modalStack_ ) {
20
20
$rootScope = _$rootScope_ ;
21
21
$document = _$document_ ;
22
22
$compile = _$compile_ ;
23
23
$templateCache = _$templateCache_ ;
24
24
$timeout = _$timeout_ ;
25
25
$q = _$q_ ;
26
26
$modal = _$modal_ ;
27
+ $modalStack = _$modalStack_ ;
27
28
} ) ) ;
28
29
29
30
beforeEach ( function ( ) {
@@ -796,12 +797,14 @@ describe('$modal', function () {
796
797
797
798
// Calls emit n! times on arrays of length n containing all non-repeating permutations of the integers 0..n-1.
798
799
function permute ( n , emit ) {
799
- if ( n < 1 || typeof emit !== 'function' ) return ;
800
+ if ( n < 1 || typeof emit !== 'function' ) {
801
+ return ;
802
+ }
800
803
var a = [ ] ;
801
804
function _permute ( depth ) {
802
805
index: for ( var i = 0 ; i < n ; i ++ ) {
803
806
for ( var j = 0 ; j < depth ; j ++ ) {
804
- if ( a [ j ] == i ) {
807
+ if ( a [ j ] === i ) {
805
808
continue index; // already used
806
809
}
807
810
}
@@ -819,11 +822,11 @@ describe('$modal', function () {
819
822
820
823
permute ( 2 , function ( a ) { test ( a ) ; } ) ;
821
824
permute ( 2 , function ( a ) { test ( a . map ( function ( x , i ) { return { reject :x } ; } ) ) ; } ) ;
822
- permute ( 2 , function ( a ) { test ( a . map ( function ( x , i ) { return i == 0 ? { reject :x } : x ; } ) ) ; } ) ;
825
+ permute ( 2 , function ( a ) { test ( a . map ( function ( x , i ) { return i === 0 ? { reject :x } : x ; } ) ) ; } ) ;
823
826
permute ( 3 , function ( a ) { test ( a ) ; } ) ;
824
827
permute ( 3 , function ( a ) { test ( a . map ( function ( x , i ) { return { reject :x } ; } ) ) ; } ) ;
825
- permute ( 3 , function ( a ) { test ( a . map ( function ( x , i ) { return i == 0 ? { reject :x } : x ; } ) ) ; } ) ;
826
- permute ( 3 , function ( a ) { test ( a . map ( function ( x , i ) { return i == 1 ? { reject :x } : x ; } ) ) ; } ) ;
828
+ permute ( 3 , function ( a ) { test ( a . map ( function ( x , i ) { return i === 0 ? { reject :x } : x ; } ) ) ; } ) ;
829
+ permute ( 3 , function ( a ) { test ( a . map ( function ( x , i ) { return i === 1 ? { reject :x } : x ; } ) ) ; } ) ;
827
830
} ) ;
828
831
} ) ;
829
832
0 commit comments