mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACS-6443] cleanup for redundant e2es and unused methods (#3547)
* [ACS-6443] removed redundant e2es and unused methods * [ACS-6443] cleanup * [ACS-6443] cleanup * [ACS-6443] undo cleanup * [ACS-6443] linting fix * [ACS-6443] cleanup * [ACS-6443] cleanup * [ACS-6443] addressed review comments
This commit is contained in:
committed by
GitHub
parent
437cf9154e
commit
78b1e3e460
@@ -25,7 +25,6 @@
|
||||
import { Logger } from '@alfresco/adf-testing';
|
||||
import { AlfrescoApi, Comment, CommentsApi, NodesApi, TrashcanApi, SitesApi, SharedlinksApi } from '@alfresco/js-api';
|
||||
import { browser } from 'protractor';
|
||||
import { Utils } from './utils';
|
||||
|
||||
export class UserActions {
|
||||
protected readonly alfrescoApi: AlfrescoApi;
|
||||
@@ -109,43 +108,6 @@ export class UserActions {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the amount of deleted nodes in the trashcan.
|
||||
* TODO: limited to 1000 items only, needs improvements.
|
||||
*/
|
||||
async getTrashcanSize(): Promise<number> {
|
||||
try {
|
||||
const response = await this.trashcanApi.listDeletedNodes({
|
||||
maxItems: 1000
|
||||
});
|
||||
|
||||
return response?.list?.pagination?.totalItems || 0;
|
||||
} catch (error) {
|
||||
this.handleError('User Actions - getTrashcanSize failed : ', error);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs multiple calls to retrieve the size of the trashcan until the expectedSize is reached.
|
||||
* Used with eventual consistency calls.
|
||||
* @param expectedSize Size of the trashcan to wait for.
|
||||
*/
|
||||
async waitForTrashcanSize(expectedSize: number): Promise<number> {
|
||||
return Utils.retryCall(async () => {
|
||||
const totalItems = await this.getTrashcanSize();
|
||||
|
||||
if (totalItems !== expectedSize) {
|
||||
return Promise.reject(totalItems);
|
||||
} else {
|
||||
return Promise.resolve(totalItems);
|
||||
}
|
||||
}).catch((error) => {
|
||||
this.handleError('User Actions - waitForTrashcanSize failed : ', error);
|
||||
return -1;
|
||||
});
|
||||
}
|
||||
|
||||
async lockNodes(nodeIds: string[], lockType: string = 'ALLOW_OWNER_CHANGES') {
|
||||
try {
|
||||
for (const nodeId of nodeIds) {
|
||||
|
Reference in New Issue
Block a user