[ACA-1890][ACA-1798] metadata extension e2e (#711)

* [ACA-1890] make sure that the metadata component uses the extension settings

* [ACA-1798] remove unused imports

* [ACA-1798] test metadata extension

* format with Prettier

* [ACA-1798] changes after code review
This commit is contained in:
Suzana Dirla
2018-10-15 11:33:08 +03:00
committed by Denys Vuika
parent b9591ea37f
commit 27dcb33891
12 changed files with 1147 additions and 12 deletions

View File

@@ -91,7 +91,15 @@ export class NodesApi extends RepoApi {
return await this.deleteNodesById(nodeIds);
}
async createNode(nodeType: string, name: string, parentId: string = '-my-', title: string = '', description: string = '') {
async createImageNode(nodeType: string, name: string, parentId: string = '-my-', title: string = '', description: string = '') {
const imageProps = {
'exif:pixelXDimension': 1000,
'exif:pixelYDimension': 1200
};
return await this.createNode('cm:content', name, parentId, title, description, imageProps);
}
async createNode(nodeType: string, name: string, parentId: string = '-my-', title: string = '', description: string = '', imageProps: any = null) {
const nodeBody = {
name,
nodeType,
@@ -100,6 +108,9 @@ export class NodesApi extends RepoApi {
'cm:description': description
}
};
if (imageProps) {
nodeBody.properties = Object.assign(nodeBody.properties, imageProps);
}
await this.apiAuth();
return await this.alfrescoJsApi.core.nodesApi.addNode(parentId, nodeBody);
@@ -109,6 +120,10 @@ export class NodesApi extends RepoApi {
return await this.createNode('cm:content', name, parentId, title, description);
}
async createImage(name: string, parentId: string = '-my-', title: string = '', description: string = '') {
return await this.createImageNode('cm:content', name, parentId, title, description);
}
async createFolder(name: string, parentId: string = '-my-', title: string = '', description: string = '') {
return await this.createNode('cm:folder', name, parentId, title, description);
}