mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-10-08 14:51:32 +00:00
* Revert "AAE-30882 Replace superagent (#11134)"
This reverts commit a347b20f20
.
* AAE-0000 - Fixed lock for cli and adf
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import nock from 'nock';
|
||||
import { BaseMock } from '../base.mock';
|
||||
|
||||
const formValues = [
|
||||
@@ -41,7 +42,7 @@ const formValues = [
|
||||
|
||||
export class TasksMock extends BaseMock {
|
||||
get200Response(): void {
|
||||
this.createNockWithCors()
|
||||
nock(this.host, { encodedQueryParams: true })
|
||||
.post('/activiti-app/api/enterprise/tasks/query', {})
|
||||
.reply(200, {
|
||||
size: 2,
|
||||
@@ -127,7 +128,7 @@ export class TasksMock extends BaseMock {
|
||||
}
|
||||
|
||||
get200ResponseGetTask(taskId: string): void {
|
||||
this.createNockWithCors()
|
||||
nock(this.host, { encodedQueryParams: true })
|
||||
.get('/activiti-app/api/enterprise/tasks/' + taskId)
|
||||
.reply(200, {
|
||||
id: '10',
|
||||
@@ -165,14 +166,14 @@ export class TasksMock extends BaseMock {
|
||||
}
|
||||
|
||||
get400TaskFilter(): void {
|
||||
this.createNockWithCors().post('/activiti-app/api/enterprise/tasks/filter', {}).reply(400, {
|
||||
nock(this.host, { encodedQueryParams: true }).post('/activiti-app/api/enterprise/tasks/filter', {}).reply(400, {
|
||||
message: 'A valid filterId or filter params must be provided',
|
||||
messageKey: 'GENERAL.ERROR.BAD-REQUEST'
|
||||
});
|
||||
}
|
||||
|
||||
get200TaskFilter(): void {
|
||||
this.createNockWithCors()
|
||||
nock(this.host, { encodedQueryParams: true })
|
||||
.post('/activiti-app/api/enterprise/tasks/filter', { appDefinitionId: 1 })
|
||||
.reply(200, {
|
||||
size: 2,
|
||||
@@ -248,7 +249,7 @@ export class TasksMock extends BaseMock {
|
||||
}
|
||||
|
||||
get404CompleteTask(taskId: string): void {
|
||||
this.createNockWithCors()
|
||||
nock(this.host, { encodedQueryParams: true })
|
||||
.put('/activiti-app/api/enterprise/tasks/' + taskId + '/action/complete')
|
||||
.reply(404, {
|
||||
message: 'Task with id: ' + taskId + ' does not exist',
|
||||
@@ -257,7 +258,7 @@ export class TasksMock extends BaseMock {
|
||||
}
|
||||
|
||||
get200CreateTask(name: string): void {
|
||||
this.createNockWithCors().post('/activiti-app/api/enterprise/tasks', { name }).reply(200, {
|
||||
nock(this.host, { encodedQueryParams: true }).post('/activiti-app/api/enterprise/tasks', { name }).reply(200, {
|
||||
id: '10001',
|
||||
name: 'test-name',
|
||||
description: null,
|
||||
@@ -292,7 +293,7 @@ export class TasksMock extends BaseMock {
|
||||
}
|
||||
|
||||
get200getTaskForm(): void {
|
||||
this.createNockWithCors()
|
||||
nock(this.host, { encodedQueryParams: true })
|
||||
.get('/activiti-app/api/enterprise/task-forms/2518')
|
||||
.reply(200, {
|
||||
id: 1,
|
||||
@@ -1032,10 +1033,10 @@ export class TasksMock extends BaseMock {
|
||||
}
|
||||
|
||||
get200getRestFieldValuesColumn(): void {
|
||||
this.createNockWithCors().get('/activiti-app/api/enterprise/task-forms/1/form-values/label/user').reply(200, formValues);
|
||||
nock(this.host, { encodedQueryParams: true }).get('/activiti-app/api/enterprise/task-forms/1/form-values/label/user').reply(200, formValues);
|
||||
}
|
||||
|
||||
get200getRestFieldValues(): void {
|
||||
this.createNockWithCors().get('/activiti-app/api/enterprise/task-forms/2/form-values/label').reply(200, formValues);
|
||||
nock(this.host, { encodedQueryParams: true }).get('/activiti-app/api/enterprise/task-forms/2/form-values/label').reply(200, formValues);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user