mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACA-1762] async await pagination (#687)
* use async / await in pagination tests * add catch in waitForApi
This commit is contained in:
committed by
Denys Vuika
parent
ac99f5397d
commit
4f4a69338f
@@ -90,15 +90,20 @@ export class FavoritesApi extends RepoApi {
|
||||
}
|
||||
|
||||
async waitForApi(data) {
|
||||
try {
|
||||
const favoriteFiles = async () => {
|
||||
const totalItems = (await this.getFavorites()).list.pagination.totalItems;
|
||||
if ( totalItems < data.expect) {
|
||||
return Promise.reject(totalItems);
|
||||
} else {
|
||||
return Promise.resolve(totalItems);
|
||||
}
|
||||
const totalItems = (await this.getFavorites()).list.pagination.totalItems;
|
||||
if ( totalItems !== data.expect) {
|
||||
return Promise.reject(totalItems);
|
||||
} else {
|
||||
return Promise.resolve(totalItems);
|
||||
}
|
||||
};
|
||||
|
||||
return await Utils.retryCall(favoriteFiles);
|
||||
} catch (error) {
|
||||
console.log('-----> catch favorites: ', error);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user