@@ -18,27 +18,27 @@ describe('MatButton', () => {
1818
1919 // General button tests
2020 it ( 'should apply class based on color attribute' , ( ) => {
21- let fixture = TestBed . createComponent ( TestApp ) ;
21+ const fixture = TestBed . createComponent ( TestApp ) ;
2222
23- let testComponent = fixture . debugElement . componentInstance ;
24- let buttonDebugElement = fixture . debugElement . query ( By . css ( 'button' ) ) ! ;
25- let aDebugElement = fixture . debugElement . query ( By . css ( 'a' ) ) ! ;
23+ const testComponent = fixture . debugElement . componentInstance ;
24+ const buttonDebugElement = fixture . debugElement . query ( By . css ( 'button' ) ) ! ;
25+ const attributeDebugElement = fixture . debugElement . query ( By . css ( 'a' ) ) ! ;
2626
2727 testComponent . buttonColor = 'primary' ;
2828 fixture . detectChanges ( ) ;
2929 expect ( buttonDebugElement . nativeElement . classList . contains ( 'mat-primary' ) ) . toBe ( true ) ;
30- expect ( aDebugElement . nativeElement . classList . contains ( 'mat-primary' ) ) . toBe ( true ) ;
30+ expect ( attributeDebugElement . nativeElement . classList . contains ( 'mat-primary' ) ) . toBe ( true ) ;
3131
3232 testComponent . buttonColor = 'accent' ;
3333 fixture . detectChanges ( ) ;
3434 expect ( buttonDebugElement . nativeElement . classList . contains ( 'mat-accent' ) ) . toBe ( true ) ;
35- expect ( aDebugElement . nativeElement . classList . contains ( 'mat-accent' ) ) . toBe ( true ) ;
35+ expect ( attributeDebugElement . nativeElement . classList . contains ( 'mat-accent' ) ) . toBe ( true ) ;
3636
3737 testComponent . buttonColor = null ;
3838 fixture . detectChanges ( ) ;
3939
4040 expect ( buttonDebugElement . nativeElement . classList ) . not . toContain ( 'mat-accent' ) ;
41- expect ( aDebugElement . nativeElement . classList ) . not . toContain ( 'mat-accent' ) ;
41+ expect ( attributeDebugElement . nativeElement . classList ) . not . toContain ( 'mat-accent' ) ;
4242 } ) ;
4343
4444 it ( 'should expose the ripple instance' , ( ) => {
@@ -50,9 +50,9 @@ describe('MatButton', () => {
5050 } ) ;
5151
5252 it ( 'should not clear previous defined classes' , ( ) => {
53- let fixture = TestBed . createComponent ( TestApp ) ;
54- let testComponent = fixture . debugElement . componentInstance ;
55- let buttonDebugElement = fixture . debugElement . query ( By . css ( 'button' ) ) ! ;
53+ const fixture = TestBed . createComponent ( TestApp ) ;
54+ const testComponent = fixture . debugElement . componentInstance ;
55+ const buttonDebugElement = fixture . debugElement . query ( By . css ( 'button' ) ) ! ;
5656
5757 buttonDebugElement . nativeElement . classList . add ( 'custom-class' ) ;
5858
@@ -128,18 +128,18 @@ describe('MatButton', () => {
128128 // Regular button tests
129129 describe ( 'button[mat-button]' , ( ) => {
130130 it ( 'should handle a click on the button' , ( ) => {
131- let fixture = TestBed . createComponent ( TestApp ) ;
132- let testComponent = fixture . debugElement . componentInstance ;
133- let buttonDebugElement = fixture . debugElement . query ( By . css ( 'button' ) ) ! ;
131+ const fixture = TestBed . createComponent ( TestApp ) ;
132+ const testComponent = fixture . debugElement . componentInstance ;
133+ const buttonDebugElement = fixture . debugElement . query ( By . css ( 'button' ) ) ! ;
134134
135135 buttonDebugElement . nativeElement . click ( ) ;
136136 expect ( testComponent . clickCount ) . toBe ( 1 ) ;
137137 } ) ;
138138
139139 it ( 'should not increment if disabled' , ( ) => {
140- let fixture = TestBed . createComponent ( TestApp ) ;
141- let testComponent = fixture . debugElement . componentInstance ;
142- let buttonDebugElement = fixture . debugElement . query ( By . css ( 'button' ) ) ! ;
140+ const fixture = TestBed . createComponent ( TestApp ) ;
141+ const testComponent = fixture . debugElement . componentInstance ;
142+ const buttonDebugElement = fixture . debugElement . query ( By . css ( 'button' ) ) ! ;
143143
144144 testComponent . isDisabled = true ;
145145 fixture . detectChanges ( ) ;
@@ -150,8 +150,8 @@ describe('MatButton', () => {
150150 } ) ;
151151
152152 it ( 'should disable the native button element' , ( ) => {
153- let fixture = TestBed . createComponent ( TestApp ) ;
154- let buttonNativeElement = fixture . nativeElement . querySelector ( 'button' ) ;
153+ const fixture = TestBed . createComponent ( TestApp ) ;
154+ const buttonNativeElement = fixture . nativeElement . querySelector ( 'button' ) ;
155155 expect ( buttonNativeElement . disabled ) . toBeFalsy ( 'Expected button not to be disabled' ) ;
156156
157157 fixture . componentInstance . isDisabled = true ;
@@ -164,9 +164,9 @@ describe('MatButton', () => {
164164 // Anchor button tests
165165 describe ( 'a[mat-button]' , ( ) => {
166166 it ( 'should not redirect if disabled' , ( ) => {
167- let fixture = TestBed . createComponent ( TestApp ) ;
168- let testComponent = fixture . debugElement . componentInstance ;
169- let buttonDebugElement = fixture . debugElement . query ( By . css ( 'a' ) ) ! ;
167+ const fixture = TestBed . createComponent ( TestApp ) ;
168+ const testComponent = fixture . debugElement . componentInstance ;
169+ const buttonDebugElement = fixture . debugElement . query ( By . css ( 'a' ) ) ! ;
170170
171171 testComponent . isDisabled = true ;
172172 fixture . detectChanges ( ) ;
@@ -175,9 +175,9 @@ describe('MatButton', () => {
175175 } ) ;
176176
177177 it ( 'should remove tabindex if disabled' , ( ) => {
178- let fixture = TestBed . createComponent ( TestApp ) ;
179- let testComponent = fixture . debugElement . componentInstance ;
180- let buttonDebugElement = fixture . debugElement . query ( By . css ( 'a' ) ) ! ;
178+ const fixture = TestBed . createComponent ( TestApp ) ;
179+ const testComponent = fixture . debugElement . componentInstance ;
180+ const buttonDebugElement = fixture . debugElement . query ( By . css ( 'a' ) ) ! ;
181181 expect ( buttonDebugElement . nativeElement . getAttribute ( 'tabIndex' ) ) . toBe ( null ) ;
182182
183183 testComponent . isDisabled = true ;
@@ -186,9 +186,9 @@ describe('MatButton', () => {
186186 } ) ;
187187
188188 it ( 'should add aria-disabled attribute if disabled' , ( ) => {
189- let fixture = TestBed . createComponent ( TestApp ) ;
190- let testComponent = fixture . debugElement . componentInstance ;
191- let buttonDebugElement = fixture . debugElement . query ( By . css ( 'a' ) ) ! ;
189+ const fixture = TestBed . createComponent ( TestApp ) ;
190+ const testComponent = fixture . debugElement . componentInstance ;
191+ const buttonDebugElement = fixture . debugElement . query ( By . css ( 'a' ) ) ! ;
192192 fixture . detectChanges ( ) ;
193193 expect ( buttonDebugElement . nativeElement . getAttribute ( 'aria-disabled' ) ) . toBe ( 'false' ) ;
194194
@@ -198,9 +198,9 @@ describe('MatButton', () => {
198198 } ) ;
199199
200200 it ( 'should not add aria-disabled attribute if disabled is false' , ( ) => {
201- let fixture = TestBed . createComponent ( TestApp ) ;
202- let testComponent = fixture . debugElement . componentInstance ;
203- let buttonDebugElement = fixture . debugElement . query ( By . css ( 'a' ) ) ! ;
201+ const fixture = TestBed . createComponent ( TestApp ) ;
202+ const testComponent = fixture . debugElement . componentInstance ;
203+ const buttonDebugElement = fixture . debugElement . query ( By . css ( 'a' ) ) ! ;
204204 fixture . detectChanges ( ) ;
205205 expect ( buttonDebugElement . nativeElement . getAttribute ( 'aria-disabled' ) )
206206 . toBe ( 'false' , 'Expect aria-disabled="false"' ) ;
@@ -216,9 +216,9 @@ describe('MatButton', () => {
216216 } ) ;
217217
218218 it ( 'should be able to set a custom tabindex' , ( ) => {
219- let fixture = TestBed . createComponent ( TestApp ) ;
220- let testComponent = fixture . debugElement . componentInstance ;
221- let buttonElement = fixture . debugElement . query ( By . css ( 'a' ) ) ! . nativeElement ;
219+ const fixture = TestBed . createComponent ( TestApp ) ;
220+ const testComponent = fixture . debugElement . componentInstance ;
221+ const buttonElement = fixture . debugElement . query ( By . css ( 'a' ) ) ! . nativeElement ;
222222
223223 fixture . componentInstance . tabIndex = 3 ;
224224 fixture . detectChanges ( ) ;
0 commit comments