mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACA-1258] automate tests for viewing file/image properties (#1101)
* split InfoDrawer test component and add tests for viewing properties * add “date item” to spell ignore and remove commented code * try to increase timeout
This commit is contained in:
committed by
Suzana Dirla
parent
996975fdb5
commit
d5f8699976
@@ -141,13 +141,14 @@ export class NodesApi extends RepoApi {
|
||||
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, majorVersion: boolean = true) {
|
||||
async createNode(nodeType: string, name: string, parentId: string = '-my-', title: string = '', description: string = '', imageProps: any = null, author: string = '', majorVersion: boolean = true) {
|
||||
const nodeBody = {
|
||||
name,
|
||||
nodeType,
|
||||
properties: {
|
||||
'cm:title': title,
|
||||
'cm:description': description
|
||||
'cm:description': description,
|
||||
'cm:author': author
|
||||
}
|
||||
};
|
||||
if (imageProps) {
|
||||
@@ -155,22 +156,32 @@ export class NodesApi extends RepoApi {
|
||||
}
|
||||
|
||||
await this.apiAuth();
|
||||
return await this.nodesApi.createNode(parentId, nodeBody, { majorVersion });
|
||||
|
||||
try {
|
||||
return await this.nodesApi.createNode(parentId, nodeBody, { majorVersion });
|
||||
} catch (error) {
|
||||
console.log('===========> API create node catch ===========');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async createFile(name: string, parentId: string = '-my-', title: string = '', description: string = '', majorVersion: boolean = true) {
|
||||
return await this.createNode('cm:content', name, parentId, title, description, majorVersion);
|
||||
async createFile(name: string, parentId: string = '-my-', title: string = '', description: string = '', author: string = '', majorVersion: boolean = true) {
|
||||
return await this.createNode('cm:content', name, parentId, title, description, null, author, majorVersion);
|
||||
}
|
||||
|
||||
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);
|
||||
async createFolder(name: string, parentId: string = '-my-', title: string = '', description: string = '', author: string = '') {
|
||||
try {
|
||||
return await this.createNode('cm:folder', name, parentId, title, description, null, author);
|
||||
} catch (error) {
|
||||
console.log('======> API create folder catch ==========');
|
||||
}
|
||||
}
|
||||
|
||||
async createChildren(data: NodeBodyCreate[]): Promise<any> {
|
||||
async createChildren(data: NodeBodyCreate[]) {
|
||||
await this.apiAuth();
|
||||
return await this.nodesApi.createNode('-my-', <any>data);
|
||||
}
|
||||
|
Reference in New Issue
Block a user