@@ -33,7 +33,7 @@ describe('rating directive', function() {
33
33
return angular . element ( star ) . attr ( 'title' ) ;
34
34
} ) ;
35
35
}
36
-
36
+
37
37
function triggerKeyDown ( keyCode ) {
38
38
var e = $ . Event ( 'keydown' ) ;
39
39
e . which = keyCode ;
@@ -280,13 +280,13 @@ describe('rating directive', function() {
280
280
expect ( getState ( 'on' , 'off' ) ) . toEqual ( [ true , true , true , true , true , false , false , false , false , false ] ) ;
281
281
} ) ;
282
282
} ) ;
283
-
283
+
284
284
describe ( 'Default title' , function ( ) {
285
285
it ( 'should return the default title for each star' , function ( ) {
286
286
expect ( getTitles ( ) ) . toEqual ( [ 'one' , 'two' , 'three' , 'four' , 'five' ] ) ;
287
287
} ) ;
288
288
} ) ;
289
-
289
+
290
290
describe ( 'shows different title when `max` attribute is greater than the titles array ' , function ( ) {
291
291
var originalConfig = { } ;
292
292
beforeEach ( inject ( function ( uibRatingConfig ) {
@@ -300,12 +300,12 @@ describe('rating directive', function() {
300
300
// return it to the original state
301
301
angular . extend ( uibRatingConfig , originalConfig ) ;
302
302
} ) ) ;
303
-
303
+
304
304
it ( 'should return the default title for each star' , function ( ) {
305
305
expect ( getTitles ( ) ) . toEqual ( [ 'one' , 'two' , 'three' , 'four' , 'five' , '6' , '7' , '8' , '9' , '10' ] ) ;
306
306
} ) ;
307
307
} ) ;
308
-
308
+
309
309
describe ( 'shows custom titles ' , function ( ) {
310
310
it ( 'should return the custom title for each star' , function ( ) {
311
311
$rootScope . titles = [ 44 , 45 , 46 ] ;
@@ -326,36 +326,3 @@ describe('rating directive', function() {
326
326
} ) ;
327
327
} ) ;
328
328
} ) ;
329
-
330
- /* Deprecation tests below */
331
-
332
- describe ( 'rating deprecation' , function ( ) {
333
- beforeEach ( module ( 'ui.bootstrap.rating' ) ) ;
334
- beforeEach ( module ( 'template/rating/rating.html' ) ) ;
335
-
336
- it ( 'should suppress warning' , function ( ) {
337
- module ( function ( $provide ) {
338
- $provide . value ( '$ratingSuppressWarning' , true ) ;
339
- } ) ;
340
-
341
- inject ( function ( $compile , $log , $rootScope ) {
342
- spyOn ( $log , 'warn' ) ;
343
-
344
- var element = $compile ( '<rating ng-model="rate"></rating>' ) ( $rootScope ) ;
345
- $rootScope . $digest ( ) ;
346
-
347
- expect ( $log . warn . calls . count ( ) ) . toBe ( 0 ) ;
348
- } ) ;
349
- } ) ;
350
-
351
- it ( 'should give warning by default' , inject ( function ( $compile , $log , $rootScope ) {
352
- spyOn ( $log , 'warn' ) ;
353
-
354
- var element = $compile ( '<rating ng-model="rate"></rating>' ) ( $rootScope ) ;
355
- $rootScope . $digest ( ) ;
356
-
357
- expect ( $log . warn . calls . count ( ) ) . toBe ( 2 ) ;
358
- expect ( $log . warn . calls . argsFor ( 0 ) ) . toEqual ( [ 'RatingController is now deprecated. Use UibRatingController instead.' ] ) ;
359
- expect ( $log . warn . calls . argsFor ( 1 ) ) . toEqual ( [ 'rating is now deprecated. Use uib-rating instead.' ] ) ;
360
- } ) ) ;
361
- } ) ;
0 commit comments