mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
add more e2e tests (#851)
This commit is contained in:
committed by
Denys Vuika
parent
e020dc4b77
commit
d0ff69c5dc
@@ -46,12 +46,9 @@ export class NodesApi extends RepoApi {
|
||||
return await this.alfrescoJsApi.core.nodesApi.getNode(id);
|
||||
}
|
||||
|
||||
async getNodeDescription(name: string, relativePath: string = '/') {
|
||||
relativePath = (relativePath === '/')
|
||||
? `${name}`
|
||||
: `${relativePath}/${name}`;
|
||||
|
||||
return (await this.getNodeByPath(`${relativePath}`)).entry.properties['cm:description'];
|
||||
async getNodeDescription(name: string, parentId: string) {
|
||||
const children = (await this.getNodeChildren(parentId)).list.entries;
|
||||
return children.find(elem => elem.entry.name === name).entry.properties['cm:description'];
|
||||
}
|
||||
|
||||
async getNodeProperty(nodeId: string, property: string) {
|
||||
@@ -93,8 +90,11 @@ export class NodesApi extends RepoApi {
|
||||
// children
|
||||
|
||||
async getNodeChildren(nodeId: string) {
|
||||
const opts = {
|
||||
include: [ 'properties' ]
|
||||
};
|
||||
await this.apiAuth();
|
||||
return await this.alfrescoJsApi.core.nodesApi.getNodeChildren(nodeId);
|
||||
return await this.alfrescoJsApi.core.nodesApi.getNodeChildren(nodeId, opts);
|
||||
}
|
||||
|
||||
async deleteNodeChildren(parentId: string) {
|
||||
|
@@ -128,6 +128,24 @@ export class SitesApi extends RepoApi {
|
||||
return await this.alfrescoJsApi.core.sitesApi.removeSiteMember(siteId, userId);
|
||||
}
|
||||
|
||||
async requestToJoin(siteId: string) {
|
||||
const body = {
|
||||
id: siteId
|
||||
};
|
||||
await this.apiAuth();
|
||||
try {
|
||||
return await this.alfrescoJsApi.core.peopleApi.addSiteMembershipRequest('-me-', body);
|
||||
} catch (error) {
|
||||
console.log('====== requestToJoin catch ', error);
|
||||
};
|
||||
}
|
||||
|
||||
async hasMembershipRequest(siteId: string) {
|
||||
await this.apiAuth();
|
||||
const requests = (await this.alfrescoJsApi.core.peopleApi.getSiteMembershipRequests('-me-')).list.entries.map(e => e.entry.id);
|
||||
return requests.includes(siteId);
|
||||
}
|
||||
|
||||
async waitForApi(data) {
|
||||
try {
|
||||
const sites = async () => {
|
||||
|
Reference in New Issue
Block a user