mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACA-1767] add viewer actions tests in other list views (#646)
This commit is contained in:
committed by
Denys Vuika
parent
85599f6739
commit
0f3fffcff4
@@ -85,6 +85,12 @@ export class NodesApi extends RepoApi {
|
||||
return await this.alfrescoJsApi.core.nodesApi.getNodeChildren(nodeId);
|
||||
}
|
||||
|
||||
async deleteNodeChildren(parentId: string) {
|
||||
const nodeIds = (await this.getNodeChildren(parentId)).list.entries
|
||||
.map(entries => entries.entry.id);
|
||||
return await this.deleteNodesById(nodeIds);
|
||||
}
|
||||
|
||||
async createNode(nodeType: string, name: string, parentId: string = '-my-', title: string = '', description: string = '') {
|
||||
const nodeBody = {
|
||||
name,
|
||||
|
@@ -37,7 +37,7 @@ export class UploadApi extends RepoApi {
|
||||
async uploadFile(fileName: string, parentFolderId: string = '-my-') {
|
||||
const file = fs.createReadStream(`${E2E_ROOT_PATH}/resources/test-files/${fileName}`);
|
||||
const opts = {
|
||||
mane: file.name,
|
||||
name: file.name,
|
||||
nodeType: 'cm:content'
|
||||
};
|
||||
|
||||
@@ -45,4 +45,15 @@ export class UploadApi extends RepoApi {
|
||||
return await this.alfrescoJsApi.upload.uploadFile(file, '', parentFolderId, null, opts);
|
||||
}
|
||||
|
||||
async uploadFileWithRename(fileName: string, parentFolderId: string = '-my-', newName: string) {
|
||||
const file = fs.createReadStream(`${E2E_ROOT_PATH}/resources/test-files/${fileName}`);
|
||||
const opts = {
|
||||
name: newName,
|
||||
nodeType: 'cm:content'
|
||||
};
|
||||
|
||||
await this.apiAuth();
|
||||
return await this.alfrescoJsApi.upload.uploadFile(file, '', parentFolderId, null, opts);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user