mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACA-4507] Fix folder tests (#2227)
* [ACA-4507] Fix folder tests * * wait for recent files * * increase timeouts * * fix comments * * search untill found * Revert: * wait for recent files (7be52b12) * * update timeout * * upload fixed and improve recent files
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
*/
|
||||
|
||||
import { RepoApi } from '../repo-api';
|
||||
import { Logger } from '@alfresco/adf-testing';
|
||||
import { ApiUtil, Logger } from '@alfresco/adf-testing';
|
||||
import { Utils } from '../../../../utilities/utils';
|
||||
import { SearchApi as AdfSearchApi } from '@alfresco/js-api';
|
||||
|
||||
@@ -130,17 +130,18 @@ export class SearchApi extends RepoApi {
|
||||
}
|
||||
|
||||
async waitForNodes(searchTerm: string, data: { expect: number }) {
|
||||
try {
|
||||
const nodes = async () => {
|
||||
const totalItems = await this.getSearchByTermTotalItems(searchTerm);
|
||||
if (totalItems !== data.expect) {
|
||||
return Promise.reject(totalItems);
|
||||
} else {
|
||||
return Promise.resolve(totalItems);
|
||||
}
|
||||
};
|
||||
const predicate = (totalItems: number) => totalItems === data.expect;
|
||||
|
||||
return await Utils.retryCall(nodes);
|
||||
const apiCall = async () => {
|
||||
try {
|
||||
return await this.getSearchByTermTotalItems(searchTerm);
|
||||
} catch (error) {
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
try {
|
||||
await ApiUtil.waitForApi(apiCall, predicate, 30, 2500);
|
||||
} catch (error) {
|
||||
Logger.error(`SearchApi waitForNodes : catch : `);
|
||||
Logger.error(`\tExpected: ${data.expect} items, but found ${error}`);
|
||||
|
Reference in New Issue
Block a user