Skip to content

Commit 2895bd3

Browse files
nitinmalavemmalerba
authored andcommitted
refactor(material/progress-spinner): refactor variable type to const in progress-spinner component unit tests (#22841)
(cherry picked from commit 0c33b2e)
1 parent d2481af commit 2895bd3

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

src/material/progress-spinner/progress-spinner.spec.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,32 +30,32 @@ describe('MatProgressSpinner', () => {
3030
}));
3131

3232
it('should apply a mode of "determinate" if no mode is provided.', () => {
33-
let fixture = TestBed.createComponent(BasicProgressSpinner);
33+
const fixture = TestBed.createComponent(BasicProgressSpinner);
3434
fixture.detectChanges();
3535

36-
let progressElement = fixture.debugElement.query(By.css('mat-progress-spinner'))!;
36+
const progressElement = fixture.debugElement.query(By.css('mat-progress-spinner'))!;
3737
expect(progressElement.componentInstance.mode).toBe('determinate');
3838
});
3939

4040
it('should not modify the mode if a valid mode is provided.', () => {
41-
let fixture = TestBed.createComponent(IndeterminateProgressSpinner);
41+
const fixture = TestBed.createComponent(IndeterminateProgressSpinner);
4242
fixture.detectChanges();
4343

44-
let progressElement = fixture.debugElement.query(By.css('mat-progress-spinner'))!;
44+
const progressElement = fixture.debugElement.query(By.css('mat-progress-spinner'))!;
4545
expect(progressElement.componentInstance.mode).toBe('indeterminate');
4646
});
4747

4848
it('should define a default value of zero for the value attribute', () => {
49-
let fixture = TestBed.createComponent(BasicProgressSpinner);
49+
const fixture = TestBed.createComponent(BasicProgressSpinner);
5050
fixture.detectChanges();
5151

52-
let progressElement = fixture.debugElement.query(By.css('mat-progress-spinner'))!;
52+
const progressElement = fixture.debugElement.query(By.css('mat-progress-spinner'))!;
5353
expect(progressElement.componentInstance.value).toBe(0);
5454
});
5555

5656
it('should set the value to 0 when the mode is set to indeterminate', () => {
57-
let fixture = TestBed.createComponent(ProgressSpinnerWithValueAndBoundMode);
58-
let progressElement = fixture.debugElement.query(By.css('mat-progress-spinner'))!;
57+
const fixture = TestBed.createComponent(ProgressSpinnerWithValueAndBoundMode);
58+
const progressElement = fixture.debugElement.query(By.css('mat-progress-spinner'))!;
5959
fixture.componentInstance.mode = 'determinate';
6060
fixture.detectChanges();
6161

@@ -66,8 +66,8 @@ describe('MatProgressSpinner', () => {
6666
});
6767

6868
it('should retain the value if it updates while indeterminate', () => {
69-
let fixture = TestBed.createComponent(ProgressSpinnerWithValueAndBoundMode);
70-
let progressElement = fixture.debugElement.query(By.css('mat-progress-spinner'))!;
69+
const fixture = TestBed.createComponent(ProgressSpinnerWithValueAndBoundMode);
70+
const progressElement = fixture.debugElement.query(By.css('mat-progress-spinner'))!;
7171

7272
fixture.componentInstance.mode = 'determinate';
7373
fixture.detectChanges();
@@ -105,11 +105,11 @@ describe('MatProgressSpinner', () => {
105105
});
106106

107107
it('should clamp the value of the progress between 0 and 100', () => {
108-
let fixture = TestBed.createComponent(BasicProgressSpinner);
108+
const fixture = TestBed.createComponent(BasicProgressSpinner);
109109
fixture.detectChanges();
110110

111-
let progressElement = fixture.debugElement.query(By.css('mat-progress-spinner'))!;
112-
let progressComponent = progressElement.componentInstance;
111+
const progressElement = fixture.debugElement.query(By.css('mat-progress-spinner'))!;
112+
const progressComponent = progressElement.componentInstance;
113113

114114
progressComponent.value = 50;
115115
expect(progressComponent.value).toBe(50);
@@ -281,10 +281,10 @@ describe('MatProgressSpinner', () => {
281281
});
282282

283283
it('should set the color class on the mat-spinner', () => {
284-
let fixture = TestBed.createComponent(SpinnerWithColor);
284+
const fixture = TestBed.createComponent(SpinnerWithColor);
285285
fixture.detectChanges();
286286

287-
let progressElement = fixture.debugElement.query(By.css('mat-spinner'))!;
287+
const progressElement = fixture.debugElement.query(By.css('mat-spinner'))!;
288288

289289
expect(progressElement.nativeElement.classList).toContain('mat-primary');
290290

@@ -296,10 +296,10 @@ describe('MatProgressSpinner', () => {
296296
});
297297

298298
it('should set the color class on the mat-progress-spinner', () => {
299-
let fixture = TestBed.createComponent(ProgressSpinnerWithColor);
299+
const fixture = TestBed.createComponent(ProgressSpinnerWithColor);
300300
fixture.detectChanges();
301301

302-
let progressElement = fixture.debugElement.query(By.css('mat-progress-spinner'))!;
302+
const progressElement = fixture.debugElement.query(By.css('mat-progress-spinner'))!;
303303

304304
expect(progressElement.nativeElement.classList).toContain('mat-primary');
305305

@@ -337,8 +337,8 @@ describe('MatProgressSpinner', () => {
337337
});
338338

339339
it('should update the element size when changed dynamically', () => {
340-
let fixture = TestBed.createComponent(BasicProgressSpinner);
341-
let spinner = fixture.debugElement.query(By.directive(MatProgressSpinner))!;
340+
const fixture = TestBed.createComponent(BasicProgressSpinner);
341+
const spinner = fixture.debugElement.query(By.directive(MatProgressSpinner))!;
342342
spinner.componentInstance.diameter = 32;
343343
fixture.detectChanges();
344344
expect(spinner.nativeElement.style.width).toBe('32px');

0 commit comments

Comments
 (0)