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

@@ -28,13 +28,13 @@ import { browser, Key } from 'protractor';
describe('Create folder directive', function () {
let loginPage = new LoginPage();
let contentServicesPage = new ContentServicesPage();
let createFolderDialog = new CreateFolderDialog();
let notificationPage = new NotificationPage();
let metadataViewPage = new MetadataViewPage();
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const createFolderDialog = new CreateFolderDialog();
const notificationPage = new NotificationPage();
const metadataViewPage = new MetadataViewPage();
let acsUser = new AcsUserModel();
const acsUser = new AcsUserModel();
beforeAll(async (done) => {
this.alfrescoJsApi = new AlfrescoApi({
@@ -64,7 +64,7 @@ describe('Create folder directive', function () {
});
it('[C260154] Should not create the folder if cancel button is clicked', () => {
let folderName = 'cancelFolder';
const folderName = 'cancelFolder';
contentServicesPage.clickOnCreateNewFolder();
createFolderDialog.addFolderName(folderName);
@@ -74,7 +74,7 @@ describe('Create folder directive', function () {
});
it('[C260155] Should enable the Create button only when a folder name is present', () => {
let folderName = 'NotEnableFolder';
const folderName = 'NotEnableFolder';
contentServicesPage.clickOnCreateNewFolder();
createFolderDialog.checkCreateBtnIsDisabled();
@@ -85,7 +85,7 @@ describe('Create folder directive', function () {
});
it('[C260156] Should not be possible create two folder with the same name', () => {
let folderName = 'duplicate';
const folderName = 'duplicate';
contentServicesPage.createNewFolder(folderName);
contentServicesPage.checkContentIsDisplayed(folderName);
@@ -96,7 +96,7 @@ describe('Create folder directive', function () {
});
it('[C260157] Should be possible create a folder under a folder with the same name', () => {
let folderName = 'sameSubFolder';
const folderName = 'sameSubFolder';
contentServicesPage.createNewFolder(folderName);
contentServicesPage.checkContentIsDisplayed(folderName);
@@ -108,8 +108,8 @@ describe('Create folder directive', function () {
});
it('[C260158] Should be possible add a folder description when create a new folder', () => {
let folderName = 'folderDescription';
let description = 'this is the description';
const folderName = 'folderDescription';
const description = 'this is the description';
contentServicesPage.clickOnCreateNewFolder();

View File

@@ -28,12 +28,12 @@ import { Util } from '../../util/util';
describe('Create library directive', function () {
let loginPage = new LoginPage();
let contentServicesPage = new ContentServicesPage();
let createLibraryDialog = new CreateLibraryDialog();
let customSourcesPage = new CustomSources();
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const createLibraryDialog = new CreateLibraryDialog();
const customSourcesPage = new CustomSources();
let visibility = {
const visibility = {
public: 'Public',
private: 'Private',
moderated: 'Moderated'
@@ -41,7 +41,7 @@ describe('Create library directive', function () {
let createSite;
let acsUser = new AcsUserModel();
const acsUser = new AcsUserModel();
beforeAll(async (done) => {
this.alfrescoJsApi = new AlfrescoApi({
@@ -88,7 +88,7 @@ describe('Create library directive', function () {
});
it('[C290159] Should close the dialog when clicking Cancel button', () => {
let libraryName = 'cancelLibrary';
const libraryName = 'cancelLibrary';
createLibraryDialog.typeLibraryName(libraryName);
@@ -98,8 +98,8 @@ describe('Create library directive', function () {
});
it('[C290160] Should create a public library', () => {
let libraryName = Util.generateRandomString();
let libraryDescription = Util.generateRandomString();
const libraryName = Util.generateRandomString();
const libraryDescription = Util.generateRandomString();
createLibraryDialog.typeLibraryName(libraryName);
createLibraryDialog.typeLibraryDescription(libraryDescription);
createLibraryDialog.selectPublic();
@@ -119,8 +119,8 @@ describe('Create library directive', function () {
});
it('[C290173] Should create a private library', () => {
let libraryName = Util.generateRandomString();
let libraryDescription = Util.generateRandomString();
const libraryName = Util.generateRandomString();
const libraryDescription = Util.generateRandomString();
createLibraryDialog.typeLibraryName(libraryName);
createLibraryDialog.typeLibraryDescription(libraryDescription);
createLibraryDialog.selectPrivate();
@@ -140,9 +140,9 @@ describe('Create library directive', function () {
});
it('[C290174, C290175] Should create a moderated library with a given Library ID', () => {
let libraryName = Util.generateRandomString();
let libraryId = Util.generateRandomString();
let libraryDescription = Util.generateRandomString();
const libraryName = Util.generateRandomString();
const libraryId = Util.generateRandomString();
const libraryDescription = Util.generateRandomString();
createLibraryDialog.typeLibraryName(libraryName);
createLibraryDialog.typeLibraryId(libraryId);
createLibraryDialog.typeLibraryDescription(libraryDescription);
@@ -163,7 +163,7 @@ describe('Create library directive', function () {
});
it('[C290163] Should disable Create button when a mandatory field is not filled in', () => {
let inputValue = Util.generateRandomString();
const inputValue = Util.generateRandomString();
createLibraryDialog.typeLibraryName(inputValue);
createLibraryDialog.clearLibraryId();
@@ -179,8 +179,8 @@ describe('Create library directive', function () {
});
it('[C290164] Should auto-fill in the Library Id built from library name', () => {
let name: string[] = ['abcd1234', 'ab cd 12 34', 'ab cd&12+34_@link/*'];
let libraryId: string[] = ['abcd1234', 'ab-cd-12-34', 'ab-cd1234link'];
const name: string[] = ['abcd1234', 'ab cd 12 34', 'ab cd&12+34_@link/*'];
const libraryId: string[] = ['abcd1234', 'ab-cd-12-34', 'ab-cd1234link'];
for (let _i = 0; _i < 3; _i++) {
createLibraryDialog.typeLibraryName(name[_i]);
@@ -190,8 +190,8 @@ describe('Create library directive', function () {
});
it('[C290176] Should not accept special characters for Library Id', () => {
let name = 'My Library';
let libraryId: string[] = ['My New Library', 'My+New+Library123!', '<>'];
const name = 'My Library';
const libraryId: string[] = ['My New Library', 'My+New+Library123!', '<>'];
createLibraryDialog.typeLibraryName(name);
@@ -203,8 +203,8 @@ describe('Create library directive', function () {
});
it('[C291985] Should not accept less than one character name for Library name', () => {
let name = 'x';
let libraryId = 'My New Library';
const name = 'x';
const libraryId = 'My New Library';
createLibraryDialog.typeLibraryName(name);
createLibraryDialog.typeLibraryId(libraryId);
@@ -213,8 +213,8 @@ describe('Create library directive', function () {
});
it('[C291793] Should display error for Name field filled in with spaces only', () => {
let name = ' ';
let libraryId = Util.generateRandomString();
const name = ' ';
const libraryId = Util.generateRandomString();
createLibraryDialog.typeLibraryName(name);
createLibraryDialog.typeLibraryId(libraryId);
@@ -224,8 +224,8 @@ describe('Create library directive', function () {
});
it('[C290177] Should not accept a duplicate Library Id', () => {
let name = 'My Library';
let libraryId = Util.generateRandomString();
const name = 'My Library';
const libraryId = Util.generateRandomString();
createLibraryDialog.typeLibraryName(name);
createLibraryDialog.typeLibraryId(libraryId);
@@ -241,8 +241,8 @@ describe('Create library directive', function () {
});
it('[C290178] Should accept the same library name but different Library Ids', () => {
let name = createSite.entry.title;
let libraryId = Util.generateRandomString();
const name = createSite.entry.title;
const libraryId = Util.generateRandomString();
createLibraryDialog.typeLibraryName(name.toUpperCase());
createLibraryDialog.typeLibraryId(libraryId);
@@ -257,9 +257,9 @@ describe('Create library directive', function () {
});
it('[C290179] Should not accept more than the expected characters for input fields', () => {
let name = Util.generateRandomString(257);
let libraryId = Util.generateRandomString(73);
let libraryDescription = Util.generateRandomString(513);
const name = Util.generateRandomString(257);
const libraryId = Util.generateRandomString(73);
const libraryDescription = Util.generateRandomString(513);
createLibraryDialog.typeLibraryName(name);
createLibraryDialog.typeLibraryId(libraryId);