enable prefer-const rule for tslint, fix issues (#4409)

* enable prefer-const rule for tslint, fix issues

* Update content-node-selector.component.spec.ts

* Update content-node-selector.component.spec.ts

* fix const

* fix lint issues

* update tests

* update tests

* update tests

* fix code

* fix page class
This commit is contained in:
Denys Vuika
2019-03-27 09:55:30 +00:00
committed by Eugenio Romano
parent 26c5982a1a
commit a7a48e8b2b
581 changed files with 5435 additions and 5402 deletions
@@ -45,8 +45,8 @@ describe('PeopleListComponent', () => {
}));
it('should emit row click event', (done) => {
let row = new ObjectDataRow(fakeUser);
let rowEvent = new DataRowEvent(row, null);
const row = new ObjectDataRow(fakeUser);
const rowEvent = new DataRowEvent(row, null);
peopleListComponent.clickRow.subscribe((selectedUser) => {
expect(selectedUser.id).toEqual(1);
@@ -60,12 +60,12 @@ describe('PeopleListComponent', () => {
});
it('should emit row action event', (done) => {
let row = new ObjectDataRow(fakeUser);
let removeObj = {
const row = new ObjectDataRow(fakeUser);
const removeObj = {
name: 'remove',
title: 'Remove'
};
let rowActionEvent = new DataRowActionEvent(row, removeObj);
const rowActionEvent = new DataRowActionEvent(row, removeObj);
peopleListComponent.clickAction.subscribe((selectedAction: UserEventModel) => {
expect(selectedAction.type).toEqual('remove');
@@ -69,7 +69,7 @@ export class PeopleListComponent implements AfterViewInit, AfterContentInit {
onShowRowActionsMenu(event: any) {
let removeAction = {
const removeAction = {
title: 'Remove',
name: 'remove'
};
@@ -80,8 +80,8 @@ export class PeopleListComponent implements AfterViewInit, AfterContentInit {
}
onExecuteRowAction(event: any) {
let args = event.value;
let action = args.action;
const args = event.value;
const action = args.action;
this.clickAction.emit(new UserEventModel({type: action.name, value: args.row.obj}));
}
}
@@ -40,7 +40,7 @@ describe('PeopleSearchFieldComponent', () => {
});
it('should have the proper placeholder by default', () => {
let searchField = debug.query(By.css('[data-automation-id="adf-people-search-input"]')).nativeElement;
const searchField = debug.query(By.css('[data-automation-id="adf-people-search-input"]')).nativeElement;
expect(searchField.placeholder).toBe('ADF_TASK_LIST.PEOPLE.SEARCH_USER');
});
@@ -49,7 +49,7 @@ describe('PeopleSearchFieldComponent', () => {
fixture.detectChanges();
let searchField = debug.query(By.css('[data-automation-id="adf-people-search-input"]')).nativeElement;
const searchField = debug.query(By.css('[data-automation-id="adf-people-search-input"]')).nativeElement;
expect(searchField.placeholder).toBe('Arcadia Bay');
});
@@ -40,7 +40,7 @@ describe('PeopleSearchComponent', () => {
let peopleSearchComponent: PeopleSearchComponent;
let fixture: ComponentFixture<PeopleSearchComponent>;
let element: HTMLElement;
let userArray = [fakeUser, fakeSecondUser];
const userArray = [fakeUser, fakeSecondUser];
let searchInput: any;
setupTestBed({
@@ -80,7 +80,7 @@ describe('PeopleSearchComponent', () => {
fixture.whenStable().then(() => {
fixture.detectChanges();
let gatewayElement: any = element.querySelector('#search-people-list .adf-datatable-body');
const gatewayElement: any = element.querySelector('#search-people-list .adf-datatable-body');
expect(gatewayElement).not.toBeNull();
expect(gatewayElement.children.length).toBe(2);
done();
@@ -99,7 +99,7 @@ describe('PeopleSearchComponent', () => {
fixture.whenStable()
.then(() => {
peopleSearchComponent.onRowClick(fakeUser);
let addUserButton = <HTMLElement> element.querySelector('#add-people');
const addUserButton = <HTMLElement> element.querySelector('#add-people');
addUserButton.click();
});
});
@@ -115,14 +115,14 @@ describe('PeopleSearchComponent', () => {
fixture.detectChanges();
peopleSearchComponent.onRowClick(fakeUser);
let addUserButton = <HTMLElement> element.querySelector('#add-people');
const addUserButton = <HTMLElement> element.querySelector('#add-people');
addUserButton.click();
fixture.detectChanges();
fixture.whenStable()
.then(() => {
fixture.detectChanges();
let gatewayElement: any = element.querySelector('#search-people-list .adf-datatable-body');
const gatewayElement: any = element.querySelector('#search-people-list .adf-datatable-body');
expect(gatewayElement).not.toBeNull();
expect(gatewayElement.children.length).toBe(1);
done();
@@ -42,7 +42,7 @@ describe('PeopleComponent', () => {
let activitiPeopleComponent: PeopleComponent;
let fixture: ComponentFixture<PeopleComponent>;
let element: HTMLElement;
let userArray = [fakeUser, fakeSecondUser];
const userArray = [fakeUser, fakeSecondUser];
let logService: LogService;
setupTestBed({
@@ -99,7 +99,7 @@ describe('PeopleComponent', () => {
it('should show people involved', async(() => {
fixture.whenStable()
.then(() => {
let gatewayElement: any = element.querySelector('#assignment-people-list .adf-datatable-body');
const gatewayElement: any = element.querySelector('#assignment-people-list .adf-datatable-body');
expect(gatewayElement).not.toBeNull();
expect(gatewayElement.children.length).toBe(2);
});
@@ -113,7 +113,7 @@ describe('PeopleComponent', () => {
fixture.whenStable()
.then(() => {
fixture.detectChanges();
let gatewayElement: any = element.querySelector('#assignment-people-list .adf-datatable-body');
const gatewayElement: any = element.querySelector('#assignment-people-list .adf-datatable-body');
expect(gatewayElement).not.toBeNull();
expect(gatewayElement.children.length).toBe(1);
});
@@ -127,7 +127,7 @@ describe('PeopleComponent', () => {
fixture.whenStable()
.then(() => {
fixture.detectChanges();
let gatewayElement: any = element.querySelector('#assignment-people-list .adf-datatable-body');
const gatewayElement: any = element.querySelector('#assignment-people-list .adf-datatable-body');
expect(gatewayElement).not.toBeNull();
expect(gatewayElement.children.length).toBe(3);
});
@@ -206,7 +206,7 @@ describe('PeopleComponent', () => {
fixture.whenStable()
.then(() => {
fixture.detectChanges();
let gatewayElement: any = element.querySelector('#assignment-people-list .adf-datatable-body');
const gatewayElement: any = element.querySelector('#assignment-people-list .adf-datatable-body');
expect(gatewayElement).not.toBeNull();
expect(gatewayElement.children.length).toBe(2);
});
@@ -220,7 +220,7 @@ describe('PeopleComponent', () => {
fixture.whenStable()
.then(() => {
fixture.detectChanges();
let gatewayElement: any = element.querySelector('#assignment-people-list .adf-datatable-body');
const gatewayElement: any = element.querySelector('#assignment-people-list .adf-datatable-body');
expect(gatewayElement).not.toBeNull();
expect(gatewayElement.children.length).toBe(2);
});