mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Fix Upload tests
This commit is contained in:
@@ -21,39 +21,40 @@ export class AlfrescoApiMock {
|
||||
return {authentications: {basicAuth: {password: 'fake-password', type: 'fake-basic', username: 'fake-user'}}};
|
||||
}
|
||||
|
||||
}
|
||||
export module AlfrescoApiMock {
|
||||
|
||||
export class NodesApi {
|
||||
|
||||
constructor(alfrescoClient: any) {
|
||||
}
|
||||
|
||||
addNode(nodeId, nodeBody, opts) {
|
||||
if (nodeId && nodeBody.name !== 'folder-duplicate-fake') {
|
||||
return new Promise(function (resolve, reject) {
|
||||
resolve({
|
||||
entry: {
|
||||
isFile: false,
|
||||
isFolder: true
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
return new Promise(function (resolve, reject) {
|
||||
reject({
|
||||
response: {
|
||||
body: {
|
||||
error: {
|
||||
statusCode: 409
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
static get NodesApi() {
|
||||
return NodesApiMock;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export class NodesApiMock {
|
||||
|
||||
constructor(alfrescoClient: any) {
|
||||
}
|
||||
|
||||
addNode(nodeId, nodeBody, opts) {
|
||||
if (nodeId && nodeBody.name !== 'folder-duplicate-fake') {
|
||||
return new Promise(function (resolve, reject) {
|
||||
resolve({
|
||||
entry: {
|
||||
isFile: false,
|
||||
isFolder: true
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
return new Promise(function (resolve, reject) {
|
||||
reject({
|
||||
response: {
|
||||
body: {
|
||||
error: {
|
||||
statusCode: 409
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user