[ACA-1800] add tests for unsure file (#734)

small other changes
This commit is contained in:
Adina Parpalita
2018-10-18 20:32:46 +03:00
committed by Denys Vuika
parent 4536c43c9f
commit 3bf9cc1fb2
7 changed files with 946 additions and 112 deletions

View File

@@ -55,7 +55,15 @@ export class NodesApi extends RepoApi {
}
async getNodeProperty(nodeId: string, property: string) {
return (await this.getNodeById(nodeId)).entry.properties[property];
const node = await this.getNodeById(nodeId);
if (node.entry.properties) {
return node.entry.properties[property];
}
return '';
}
async isFileShared(nodeId: string) {
return (await this.getNodeProperty(nodeId, 'qshare:sharedId')) !== '';
}
async deleteNodeById(id: string, permanent: boolean = true) {