mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACA-990] Add sanity tests for Trash list view (#58)
* add sanity tests for Trash list view * small change in tests name
This commit is contained in:
committed by
Denys Vuika
parent
012bfc716f
commit
1db9710c68
@@ -33,17 +33,17 @@ export class NodesApi extends RepoApi {
|
||||
.catch(this.handleError);
|
||||
}
|
||||
|
||||
deleteNodeById(id: string): Promise<any> {
|
||||
deleteNodeById(id: string, permanent: boolean = true): Promise<any> {
|
||||
return this
|
||||
.delete(`/nodes/${id}`)
|
||||
.delete(`/nodes/${id}?permanent=${permanent}`)
|
||||
.catch(this.handleError);
|
||||
}
|
||||
|
||||
deleteNodeByPath(path: string): Promise<any> {
|
||||
deleteNodeByPath(path: string, permanent: boolean = true): Promise<any> {
|
||||
return this
|
||||
.getNodeByPath(path)
|
||||
.then((response: any): string => response.data.entry.id)
|
||||
.then((id: string): any => this.deleteNodeById(id))
|
||||
.then((id: string): any => this.deleteNodeById(id, permanent))
|
||||
.catch(this.handleError);
|
||||
}
|
||||
|
||||
@@ -56,10 +56,10 @@ export class NodesApi extends RepoApi {
|
||||
.catch(this.handleError);
|
||||
}
|
||||
|
||||
deleteNodes(names: string[], relativePath: string = ''): Promise<any> {
|
||||
deleteNodes(names: string[], relativePath: string = '', permanent: boolean = true): Promise<any> {
|
||||
const deletions = names
|
||||
.map((name: string): any => {
|
||||
return this.deleteNodeByPath(`${relativePath}/${name}`);
|
||||
return this.deleteNodeByPath(`${relativePath}/${name}`, permanent);
|
||||
});
|
||||
|
||||
return Promise.all(deletions);
|
||||
|
Reference in New Issue
Block a user