From 944a2a4de6fbefd8f65324b77d39f069ebb43efd Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Mon, 6 Jan 2025 15:42:57 -0500 Subject: [PATCH] cleanup [ci:force] --- .../task/services/task-cloud.service.spec.ts | 9 ++- .../task/start-task/mock/user-cloud.mock.ts | 20 ------ .../services/start-task-cloud.service.spec.ts | 66 ------------------- 3 files changed, 8 insertions(+), 87 deletions(-) delete mode 100644 lib/process-services-cloud/src/lib/task/start-task/mock/user-cloud.mock.ts delete mode 100644 lib/process-services-cloud/src/lib/task/start-task/services/start-task-cloud.service.spec.ts diff --git a/lib/process-services-cloud/src/lib/task/services/task-cloud.service.spec.ts b/lib/process-services-cloud/src/lib/task/services/task-cloud.service.spec.ts index e9ac0011257..783534aec05 100644 --- a/lib/process-services-cloud/src/lib/task/services/task-cloud.service.spec.ts +++ b/lib/process-services-cloud/src/lib/task/services/task-cloud.service.spec.ts @@ -25,11 +25,18 @@ import { emptyOwnerTaskDetailsCloudMock } from '../task-header/mocks/task-details-cloud.mock'; import { fakeTaskDetailsCloud } from '../task-header/mocks/fake-task-details-response.mock'; -import { cloudMockUser } from '../start-task/mock/user-cloud.mock'; import { ProcessServiceCloudTestingModule } from '../../testing/process-service-cloud.testing.module'; import { IdentityUserService } from '../../people/services/identity-user.service'; import { AdfHttpClient } from '@alfresco/adf-core/api'; +const cloudMockUser = { + id: 'fake-id-1', + username: 'AssignedTaskUser', + firstName: 'first-name-1', + lastName: 'last-name-1', + email: 'abc@xyz.com' +}; + describe('Task Cloud Service', () => { let service: TaskCloudService; let adfHttpClient: AdfHttpClient; diff --git a/lib/process-services-cloud/src/lib/task/start-task/mock/user-cloud.mock.ts b/lib/process-services-cloud/src/lib/task/start-task/mock/user-cloud.mock.ts deleted file mode 100644 index 91027ed7ffe..00000000000 --- a/lib/process-services-cloud/src/lib/task/start-task/mock/user-cloud.mock.ts +++ /dev/null @@ -1,20 +0,0 @@ -/*! - * @license - * Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export const cloudMockUser = { - id: 'fake-id-1', username: 'AssignedTaskUser', firstName: 'first-name-1', lastName: 'last-name-1', email: 'abc@xyz.com' -}; diff --git a/lib/process-services-cloud/src/lib/task/start-task/services/start-task-cloud.service.spec.ts b/lib/process-services-cloud/src/lib/task/start-task/services/start-task-cloud.service.spec.ts deleted file mode 100644 index 974b19b9547..00000000000 --- a/lib/process-services-cloud/src/lib/task/start-task/services/start-task-cloud.service.spec.ts +++ /dev/null @@ -1,66 +0,0 @@ -/*! - * @license - * Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { TestBed } from '@angular/core/testing'; -import { of, throwError } from 'rxjs'; -import { taskDetailsMock } from '../mock/task-details.mock'; -import { TaskDetailsCloudModel } from '../models/task-details-cloud.model'; -import { HttpErrorResponse } from '@angular/common/http'; -import { TaskCloudService } from '../../services/task-cloud.service'; -import { ProcessServiceCloudTestingModule } from './../../../testing/process-service-cloud.testing.module'; - -describe('StartTaskCloudService', () => { - let service: TaskCloudService; - const fakeAppName: string = 'fake-app'; - - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [ProcessServiceCloudTestingModule] - }); - service = TestBed.inject(TaskCloudService); - }); - - it('should able to create a new task ', (done) => { - spyOn(service, 'createNewTask').and.returnValue(of({ id: 'fake-id', name: 'fake-name' })); - service.createNewTask(taskDetailsMock, fakeAppName).subscribe((res: TaskDetailsCloudModel) => { - expect(res).toBeDefined(); - expect(res.id).toEqual('fake-id'); - expect(res.name).toEqual('fake-name'); - done(); - }); - }); - - it('Should not able to create a task if error occurred', () => { - const errorResponse = new HttpErrorResponse({ - error: 'Mock Error', - status: 404, - statusText: 'Not Found' - }); - - spyOn(service, 'createNewTask').and.returnValue(throwError(errorResponse)); - service.createNewTask(taskDetailsMock, fakeAppName).subscribe( - () => { - fail('expected an error, not applications'); - }, - (error) => { - expect(error.status).toEqual(404); - expect(error.statusText).toEqual('Not Found'); - expect(error.error).toEqual('Mock Error'); - } - ); - }); -});