Skip to content

Commit 1be0514

Browse files
committed
[us40] ESlint automatic fix: replace let by const
1 parent 21e81ba commit 1be0514

38 files changed

+551
-546
lines changed

.idea/jsLinters/eslint.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/ace-editor/ace-editor.component.spec.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,31 @@ describe('AceEditorComponent', () => {
88
beforeEach(() => MockBuilder(AceEditorComponent, AppModule));
99

1010
it('should create', () => {
11-
let component = MockRender(AceEditorComponent).point.componentInstance;
11+
const component = MockRender(AceEditorComponent).point.componentInstance;
1212
expect(component).toBeTruthy();
1313
});
1414

1515
it('should set the input', () => {
1616
// Arrange
17-
let params = {
17+
const params = {
1818
value: "initialValue"
1919
};
2020

2121
// Act
22-
let component = MockRender(AceEditorComponent, params).point.componentInstance;
22+
const component = MockRender(AceEditorComponent, params).point.componentInstance;
2323

2424
// Assert
2525
expect(component.editor?.getValue()).toEqual("initialValue")
2626
});
2727

2828
it('should get the new output', fakeAsync(() => {
2929
// Arrange
30-
let output = new BehaviorSubject<string>("");
31-
let params = {
30+
const output = new BehaviorSubject<string>("");
31+
const params = {
3232
value: "oldValue",
3333
valueChange: output
3434
};
35-
let component = MockRender(AceEditorComponent, params).point.componentInstance;
35+
const component = MockRender(AceEditorComponent, params).point.componentInstance;
3636

3737
// Act
3838
component.editor?.setValue("newValue");

src/app/ace-editor/ace-editor.component.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,17 @@ export class AceEditorComponent implements MatFormFieldControl<string>, OnInit {
105105
}
106106
}
107107

108+
setDescribedByIds(ids: string[]): void {
109+
}
110+
111+
onContainerClick(event: MouseEvent): void {
112+
this.editor?.focus();
113+
}
114+
108115
private setupCustomCompletions() {
109-
let customCompleter: Completer = {
116+
const customCompleter: Completer = {
110117
getCompletions(_editor: Ace.Editor, _session: Ace.EditSession, _position: Ace.Point, _prefix: string, callback: Ace.CompleterCallback): void {
111-
let completions: Completion[] = [
118+
const completions: Completion[] = [
112119
{
113120
value: "fileName",
114121
meta: "local",
@@ -125,11 +132,4 @@ export class AceEditorComponent implements MatFormFieldControl<string>, OnInit {
125132
}
126133
this.editor?.completers.push(customCompleter);
127134
}
128-
129-
setDescribedByIds(ids: string[]): void {
130-
}
131-
132-
onContainerClick(event: MouseEvent): void {
133-
this.editor?.focus();
134-
}
135135
}

src/app/app-routing.module.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ describe('AppRoutingModule', () => {
2929

3030
beforeEach(() => {
3131
// Since we use the real UserRootComponent, we need to mock the automatic restore
32-
let databaseBackupAndRestoreService = mockDatabaseBackupAndRestoreService();
32+
const databaseBackupAndRestoreService = mockDatabaseBackupAndRestoreService();
3333
when(() => databaseBackupAndRestoreService.restore())
3434
.thenReturn(mustBeConsumedAsyncObservable(undefined));
3535
})
3636

3737
describe('when logged in', () => {
3838
beforeEach(() => {
3939
// Mock that the user is logged in
40-
let authService = mock<GoogleDriveAuthService>();
40+
const authService = mock<GoogleDriveAuthService>();
4141
MockInstance(GoogleDriveAuthService, () => {
4242
return {
4343
isAuthenticatedAndHasValidApiToken: authService.isAuthenticatedAndHasValidApiToken

src/app/app.component.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ describe('AppComponent', () => {
66
beforeEach(() => MockBuilder(AppComponent, AppModule))
77

88
it('should create the app', () => {
9-
let component = MockRender(AppComponent).point.componentInstance;
9+
const component = MockRender(AppComponent).point.componentInstance;
1010
expect(component).toBeTruthy();
1111
});
1212
});

src/app/auth/auth.guard.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ describe('authGuard', () => {
4242
describe('when we are not logged in', () => {
4343
it('redirects to login', fakeAsync(() => {
4444
// Arrange
45-
let isAuthenticatedMock = MockInstance(GoogleDriveAuthService, 'isAuthenticatedAndHasValidApiToken',
45+
const isAuthenticatedMock = MockInstance(GoogleDriveAuthService, 'isAuthenticatedAndHasValidApiToken',
4646
mock<GoogleDriveAuthService['isAuthenticatedAndHasValidApiToken']>());
4747
when(() => isAuthenticatedMock()).thenReturn(false);
4848

@@ -61,7 +61,7 @@ describe('authGuard', () => {
6161
describe('when we are already logged in', () => {
6262
it('allows navigation to root', fakeAsync(() => {
6363
// Arrange
64-
let isAuthenticatedMock = MockInstance(GoogleDriveAuthService, 'isAuthenticatedAndHasValidApiToken',
64+
const isAuthenticatedMock = MockInstance(GoogleDriveAuthService, 'isAuthenticatedAndHasValidApiToken',
6565
mock<GoogleDriveAuthService['isAuthenticatedAndHasValidApiToken']>());
6666
when(() => isAuthenticatedMock()).thenReturn(true);
6767

src/app/auth/auth.guard.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {GoogleDriveAuthService} from "../file-upload/google-drive-auth.service";
44

55
export const authGuard: CanActivateFn = (route, state) => {
66
const router = inject(Router);
7-
let googleDriveAuthService = inject(GoogleDriveAuthService);
7+
const googleDriveAuthService = inject(GoogleDriveAuthService);
88
if (!googleDriveAuthService.isAuthenticatedAndHasValidApiToken()) {
99
return router.parseUrl('/login')
1010
}

src/app/auth/auth.interceptor.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe('AuthInterceptor', () => {
1616

1717
it('triggers interceptor', () => {
1818
//Arrange
19-
let getApiTokenMock = MockInstance(GoogleDriveAuthService, 'getApiToken', mock<GoogleDriveAuthService['getApiToken']>());
19+
const getApiTokenMock = MockInstance(GoogleDriveAuthService, 'getApiToken', mock<GoogleDriveAuthService['getApiToken']>());
2020
when(() => getApiTokenMock()).thenReturn('apiToken548');
2121
MockRender();
2222
const client = ngMocks.findInstance(HttpClient);

0 commit comments

Comments
 (0)