@@ -188,9 +188,9 @@ describe('MatChipList', () => {
188
188
} ) ;
189
189
190
190
it ( 'should watch for chip focus' , ( ) => {
191
- let array = chips . toArray ( ) ;
192
- let lastIndex = array . length - 1 ;
193
- let lastItem = array [ lastIndex ] ;
191
+ const array = chips . toArray ( ) ;
192
+ const lastIndex = array . length - 1 ;
193
+ const lastItem = array [ lastIndex ] ;
194
194
195
195
lastItem . focus ( ) ;
196
196
fixture . detectChanges ( ) ;
@@ -222,8 +222,8 @@ describe('MatChipList', () => {
222
222
describe ( 'on chip destroy' , ( ) => {
223
223
224
224
it ( 'should focus the next item' , ( ) => {
225
- let array = chips . toArray ( ) ;
226
- let midItem = array [ 2 ] ;
225
+ const array = chips . toArray ( ) ;
226
+ const midItem = array [ 2 ] ;
227
227
228
228
// Focus the middle item
229
229
midItem . focus ( ) ;
@@ -237,9 +237,9 @@ describe('MatChipList', () => {
237
237
} ) ;
238
238
239
239
it ( 'should focus the previous item' , ( ) => {
240
- let array = chips . toArray ( ) ;
241
- let lastIndex = array . length - 1 ;
242
- let lastItem = array [ lastIndex ] ;
240
+ const array = chips . toArray ( ) ;
241
+ const lastIndex = array . length - 1 ;
242
+ const lastItem = array [ lastIndex ] ;
243
243
244
244
// Focus the last item
245
245
lastItem . focus ( ) ;
@@ -253,8 +253,8 @@ describe('MatChipList', () => {
253
253
} ) ;
254
254
255
255
it ( 'should not focus if chip list is not focused' , ( ) => {
256
- let array = chips . toArray ( ) ;
257
- let midItem = array [ 2 ] ;
256
+ const array = chips . toArray ( ) ;
257
+ const midItem = array [ 2 ] ;
258
258
259
259
// Focus and blur the middle item
260
260
midItem . focus ( ) ;
@@ -317,12 +317,12 @@ describe('MatChipList', () => {
317
317
} ) ;
318
318
319
319
it ( 'should focus previous item when press LEFT ARROW' , ( ) => {
320
- let nativeChips = chipListNativeElement . querySelectorAll ( 'mat-chip' ) ;
321
- let lastNativeChip = nativeChips [ nativeChips . length - 1 ] as HTMLElement ;
320
+ const nativeChips = chipListNativeElement . querySelectorAll ( 'mat-chip' ) ;
321
+ const lastNativeChip = nativeChips [ nativeChips . length - 1 ] as HTMLElement ;
322
322
323
- let array = chips . toArray ( ) ;
324
- let lastIndex = array . length - 1 ;
325
- let lastItem = array [ lastIndex ] ;
323
+ const array = chips . toArray ( ) ;
324
+ const lastIndex = array . length - 1 ;
325
+ const lastItem = array [ lastIndex ] ;
326
326
327
327
// Focus the last item in the array
328
328
lastItem . focus ( ) ;
@@ -338,11 +338,11 @@ describe('MatChipList', () => {
338
338
} ) ;
339
339
340
340
it ( 'should focus next item when press RIGHT ARROW' , ( ) => {
341
- let nativeChips = chipListNativeElement . querySelectorAll ( 'mat-chip' ) ;
342
- let firstNativeChip = nativeChips [ 0 ] as HTMLElement ;
341
+ const nativeChips = chipListNativeElement . querySelectorAll ( 'mat-chip' ) ;
342
+ const firstNativeChip = nativeChips [ 0 ] as HTMLElement ;
343
343
344
- let array = chips . toArray ( ) ;
345
- let firstItem = array [ 0 ] ;
344
+ const array = chips . toArray ( ) ;
345
+ const firstItem = array [ 0 ] ;
346
346
347
347
// Focus the last item in the array
348
348
firstItem . focus ( ) ;
@@ -406,12 +406,12 @@ describe('MatChipList', () => {
406
406
} ) ;
407
407
408
408
it ( 'should focus previous item when press RIGHT ARROW' , ( ) => {
409
- let nativeChips = chipListNativeElement . querySelectorAll ( 'mat-chip' ) ;
410
- let lastNativeChip = nativeChips [ nativeChips . length - 1 ] as HTMLElement ;
409
+ const nativeChips = chipListNativeElement . querySelectorAll ( 'mat-chip' ) ;
410
+ const lastNativeChip = nativeChips [ nativeChips . length - 1 ] as HTMLElement ;
411
411
412
- let array = chips . toArray ( ) ;
413
- let lastIndex = array . length - 1 ;
414
- let lastItem = array [ lastIndex ] ;
412
+ const array = chips . toArray ( ) ;
413
+ const lastIndex = array . length - 1 ;
414
+ const lastItem = array [ lastIndex ] ;
415
415
416
416
// Focus the last item in the array
417
417
lastItem . focus ( ) ;
@@ -427,11 +427,11 @@ describe('MatChipList', () => {
427
427
} ) ;
428
428
429
429
it ( 'should focus next item when press LEFT ARROW' , ( ) => {
430
- let nativeChips = chipListNativeElement . querySelectorAll ( 'mat-chip' ) ;
431
- let firstNativeChip = nativeChips [ 0 ] as HTMLElement ;
430
+ const nativeChips = chipListNativeElement . querySelectorAll ( 'mat-chip' ) ;
431
+ const firstNativeChip = nativeChips [ 0 ] as HTMLElement ;
432
432
433
- let array = chips . toArray ( ) ;
434
- let firstItem = array [ 0 ] ;
433
+ const array = chips . toArray ( ) ;
434
+ const firstItem = array [ 0 ] ;
435
435
436
436
// Focus the last item in the array
437
437
firstItem . focus ( ) ;
@@ -480,12 +480,12 @@ describe('MatChipList', () => {
480
480
setupStandardList ( ) ;
481
481
manager = chipListInstance . _keyManager ;
482
482
483
- let nativeChips = chipListNativeElement . querySelectorAll ( 'mat-chip' ) ;
484
- let firstNativeChip = nativeChips [ 0 ] as HTMLElement ;
483
+ const nativeChips = chipListNativeElement . querySelectorAll ( 'mat-chip' ) ;
484
+ const firstNativeChip = nativeChips [ 0 ] as HTMLElement ;
485
485
486
- let RIGHT_EVENT = createKeyboardEvent ( 'keydown' , RIGHT_ARROW ) ;
487
- let array = chips . toArray ( ) ;
488
- let firstItem = array [ 0 ] ;
486
+ const RIGHT_EVENT = createKeyboardEvent ( 'keydown' , RIGHT_ARROW ) ;
487
+ const array = chips . toArray ( ) ;
488
+ const firstItem = array [ 0 ] ;
489
489
490
490
firstItem . focus ( ) ;
491
491
expect ( manager . activeItemIndex ) . toBe ( 0 ) ;
@@ -537,7 +537,7 @@ describe('MatChipList', () => {
537
537
describe ( 'when the input has focus' , ( ) => {
538
538
539
539
it ( 'should not focus the last chip when press DELETE' , ( ) => {
540
- let nativeInput = fixture . nativeElement . querySelector ( 'input' ) ;
540
+ const nativeInput = fixture . nativeElement . querySelector ( 'input' ) ;
541
541
542
542
// Focus the input
543
543
nativeInput . focus ( ) ;
@@ -552,7 +552,7 @@ describe('MatChipList', () => {
552
552
} ) ;
553
553
554
554
it ( 'should focus the last chip when press BACKSPACE' , ( ) => {
555
- let nativeInput = fixture . nativeElement . querySelector ( 'input' ) ;
555
+ const nativeInput = fixture . nativeElement . querySelector ( 'input' ) ;
556
556
557
557
// Focus the input
558
558
nativeInput . focus ( ) ;
@@ -1307,7 +1307,7 @@ describe('MatChipList', () => {
1307
1307
} ) ;
1308
1308
1309
1309
it ( 'sets the aria-describedby to reference errors when in error state' , ( ) => {
1310
- let hintId =
1310
+ const hintId =
1311
1311
fixture . debugElement . query ( By . css ( '.mat-hint' ) ) ! . nativeElement . getAttribute ( 'id' ) ;
1312
1312
let describedBy = chipListEl . getAttribute ( 'aria-describedby' ) ;
1313
1313
@@ -1317,7 +1317,7 @@ describe('MatChipList', () => {
1317
1317
fixture . componentInstance . formControl . markAsTouched ( ) ;
1318
1318
fixture . detectChanges ( ) ;
1319
1319
1320
- let errorIds = fixture . debugElement . queryAll ( By . css ( '.mat-error' ) )
1320
+ const errorIds = fixture . debugElement . queryAll ( By . css ( '.mat-error' ) )
1321
1321
. map ( el => el . nativeElement . getAttribute ( 'id' ) ) . join ( ' ' ) ;
1322
1322
describedBy = chipListEl . getAttribute ( 'aria-describedby' ) ;
1323
1323
0 commit comments