1
1
describe ( 'carousel' , function ( ) {
2
2
beforeEach ( module ( 'ui.bootstrap.carousel' ) ) ;
3
3
beforeEach ( module ( 'template/carousel/carousel.html' , 'template/carousel/slide.html' ) ) ;
4
-
4
+
5
5
var $rootScope , $compile , $controller , $timeout ;
6
6
beforeEach ( inject ( function ( _$rootScope_ , _$compile_ , _$controller_ , _$timeout_ ) {
7
7
$rootScope = _$rootScope_ ;
@@ -24,7 +24,7 @@ describe('carousel', function() {
24
24
'<slide ng-repeat="slide in slides" active="slide.active">' +
25
25
'{{slide.content}}' +
26
26
'</slide>' +
27
- '</carousel>'
27
+ '</carousel>'
28
28
) ( scope ) ;
29
29
scope . interval = 5000 ;
30
30
scope . nopause = undefined ;
@@ -60,7 +60,7 @@ describe('carousel', function() {
60
60
var indicators = elm . find ( 'ol.carousel-indicators > li' ) ;
61
61
expect ( indicators . length ) . toBe ( 3 ) ;
62
62
} ) ;
63
-
63
+
64
64
it ( 'should hide navigation when only one slide' , function ( ) {
65
65
scope . slides = [ { active :false , content :'one' } ] ;
66
66
scope . $apply ( ) ;
@@ -69,25 +69,25 @@ describe('carousel', function() {
69
69
'<slide ng-repeat="slide in slides" active="slide.active">' +
70
70
'{{slide.content}}' +
71
71
'</slide>' +
72
- '</carousel>'
72
+ '</carousel>'
73
73
) ( scope ) ;
74
74
var indicators = elm . find ( 'ol.carousel-indicators > li' ) ;
75
75
expect ( indicators . length ) . toBe ( 0 ) ;
76
-
76
+
77
77
var navNext = elm . find ( 'a.right' ) ;
78
78
expect ( navNext . length ) . toBe ( 0 ) ;
79
-
79
+
80
80
var navPrev = elm . find ( 'a.left' ) ;
81
81
expect ( navPrev . length ) . toBe ( 0 ) ;
82
82
} ) ;
83
-
84
- it ( 'should show navigation when there are 3 slides' , function ( ) {
83
+
84
+ it ( 'should show navigation when there are 3 slides' , function ( ) {
85
85
var indicators = elm . find ( 'ol.carousel-indicators > li' ) ;
86
86
expect ( indicators . length ) . not . toBe ( 0 ) ;
87
-
87
+
88
88
var navNext = elm . find ( 'a.right' ) ;
89
89
expect ( navNext . length ) . not . toBe ( 0 ) ;
90
-
90
+
91
91
var navPrev = elm . find ( 'a.left' ) ;
92
92
expect ( navPrev . length ) . not . toBe ( 0 ) ;
93
93
} ) ;
@@ -175,7 +175,7 @@ describe('carousel', function() {
175
175
$timeout . flush ( ) ;
176
176
testSlideActive ( 2 ) ;
177
177
} ) ;
178
-
178
+
179
179
it ( 'should not pause on mouseover if noPause' , function ( ) {
180
180
scope . $apply ( 'nopause = true' ) ;
181
181
testSlideActive ( 0 ) ;
@@ -185,7 +185,7 @@ describe('carousel', function() {
185
185
elm . trigger ( 'mouseleave' ) ;
186
186
$timeout . flush ( ) ;
187
187
testSlideActive ( 2 ) ;
188
- } ) ;
188
+ } ) ;
189
189
190
190
it ( 'should remove slide from dom and change active slide' , function ( ) {
191
191
scope . $apply ( 'slides[2].active = true' ) ;
@@ -255,15 +255,15 @@ describe('carousel', function() {
255
255
describe ( 'addSlide' , function ( ) {
256
256
it ( 'should set first slide to active = true and the rest to false' , function ( ) {
257
257
angular . forEach ( ctrl . slides , function ( slide , i ) {
258
- if ( i !== 0 ) {
259
- expect ( slide . active ) . not . toBe ( true ) ;
258
+ if ( i !== 0 ) {
259
+ expect ( slide . active ) . not . toBe ( true ) ;
260
260
} else {
261
261
expect ( slide . active ) . toBe ( true ) ;
262
262
}
263
263
} ) ;
264
264
} ) ;
265
265
266
- it ( 'should add new slide and change active to true if active is true on the added slide' , function ( ) {
266
+ it ( 'should add new slide and change active to true if active is true on the added slide' , function ( ) {
267
267
var newSlide = { active : true } ;
268
268
expect ( ctrl . slides . length ) . toBe ( 4 ) ;
269
269
ctrl . addSlide ( newSlide ) ;
@@ -272,7 +272,7 @@ describe('carousel', function() {
272
272
expect ( ctrl . slides [ 0 ] . active ) . toBe ( false ) ;
273
273
} ) ;
274
274
275
- it ( 'should add a new slide and not change the active slide' , function ( ) {
275
+ it ( 'should add a new slide and not change the active slide' , function ( ) {
276
276
var newSlide = { active : false } ;
277
277
expect ( ctrl . slides . length ) . toBe ( 4 ) ;
278
278
ctrl . addSlide ( newSlide ) ;
0 commit comments