Various code fixes (#1704)

* fix typings and missing lib

* fix i18n typo, add typings

* code improvements

* fix missing awaits

* more fixes

* fix bug in the evaluators, simplify code

* more fixes
This commit is contained in:
Denys Vuika
2020-10-04 18:09:27 +01:00
committed by GitHub
parent bf11489e0f
commit 9c7ac17161
46 changed files with 133 additions and 142 deletions

View File

@@ -128,7 +128,7 @@ export class FavoritesApi extends RepoApi {
}
async isFavoriteWithRetry(nodeId: string, data: { expect: boolean }) {
let isFavorite: boolean;
let isFavorite = false;
try {
const favorite = async () => {
isFavorite = await this.isFavorite(nodeId);

View File

@@ -49,8 +49,7 @@ export class NodesApi extends RepoApi {
async getNodeById(id: string): Promise<NodeEntry | null> {
try {
await this.apiAuth();
const node = await this.nodesApi.getNode(id);
return node;
return await this.nodesApi.getNode(id);
} catch (error) {
this.handleError(`${this.constructor.name} ${this.getNodeById.name}`, error);
return null;
@@ -525,7 +524,7 @@ export class NodesApi extends RepoApi {
expect: expect,
retry: 5
};
let isLocked: boolean;
let isLocked = false;
try {
const locked = async () => {
isLocked = (await this.getLockType(nodeId)) === 'WRITE_LOCK';

View File

@@ -30,7 +30,7 @@ import { Logger } from '@alfresco/adf-testing';
export abstract class RepoApi {
alfrescoJsApi = new AlfrescoApi();
constructor(private username: string = browser.params.ADMIN_USERNAME, private password: string = browser.params.ADMIN_PASSWORD) {
protected constructor(private username: string = browser.params.ADMIN_USERNAME, private password: string = browser.params.ADMIN_PASSWORD) {
this.alfrescoJsApi.setConfig(browser.params.config);
}