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-25 12:19:33 +00:00
committed by Eugenio Romano
parent 26c5982a1a
commit a7a48e8b2b
581 changed files with 5435 additions and 5402 deletions

View File

@@ -32,7 +32,7 @@ describe('AttachFileWidgetDialogComponent', () => {
let widget: AttachFileWidgetDialogComponent;
let fixture: ComponentFixture<AttachFileWidgetDialogComponent>;
let data: AttachFileWidgetDialogComponentData = {
const data: AttachFileWidgetDialogComponentData = {
title: 'Move along citizen...',
actionName: 'move',
selected: new EventEmitter<any>(),
@@ -94,8 +94,8 @@ describe('AttachFileWidgetDialogComponent', () => {
spyOn(authService, 'login').and.returnValue(of({ type: 'type', ticket: 'ticket'}));
isLogged = true;
let loginButton: HTMLButtonElement = element.querySelector('button[data-automation-id="attach-file-dialog-actions-login"]');
let usernameInput: HTMLInputElement = element.querySelector('#username');
let passwordInput: HTMLInputElement = element.querySelector('#password');
const usernameInput: HTMLInputElement = element.querySelector('#username');
const passwordInput: HTMLInputElement = element.querySelector('#password');
usernameInput.value = 'fakse-user';
passwordInput.value = 'fakse-user';
usernameInput.dispatchEvent(new Event('input'));
@@ -105,7 +105,7 @@ describe('AttachFileWidgetDialogComponent', () => {
fixture.whenStable().then(() => {
expect(element.querySelector('#attach-file-content-node')).not.toBeNull();
loginButton = element.querySelector('button[data-automation-id="attach-file-dialog-actions-login"]');
let chooseButton = element.querySelector('button[data-automation-id="attach-file-dialog-actions-choose"]');
const chooseButton = element.querySelector('button[data-automation-id="attach-file-dialog-actions-choose"]');
expect(loginButton).toBeNull();
expect(chooseButton).not.toBeNull();
done();
@@ -137,11 +137,11 @@ describe('AttachFileWidgetDialogComponent', () => {
expect(nodeList[0].isFile).toBeTruthy();
done();
});
let fakeNode: Node = new Node({ id: 'fake', isFile: true});
const fakeNode: Node = new Node({ id: 'fake', isFile: true});
contentNodePanel.componentInstance.select.emit([fakeNode]);
fixture.detectChanges();
fixture.whenStable().then(() => {
let chooseButton: HTMLButtonElement = element.querySelector('button[data-automation-id="attach-file-dialog-actions-choose"]');
const chooseButton: HTMLButtonElement = element.querySelector('button[data-automation-id="attach-file-dialog-actions-choose"]');
chooseButton.click();
});
});