From af82c9c4fcecbf3369824649ab0e7197ce52ea5a Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Thu, 26 Feb 2026 10:08:26 +0000 Subject: [PATCH] refactor: remove ecm-user.service.mock and update references - Deleted the ecm-user.service.mock file to eliminate unused mock data, enhancing code clarity. - Updated public API exports to remove the reference to the deleted mock file. - Introduced the fakeEcmUser object directly in the people-content.service.spec.ts for improved test isolation and maintainability. --- .../lib/common/mocks/ecm-user.service.mock.ts | 39 ------------------- .../src/lib/common/public-api.ts | 1 - .../services/people-content.service.spec.ts | 24 +++++++++++- 3 files changed, 22 insertions(+), 42 deletions(-) delete mode 100644 lib/content-services/src/lib/common/mocks/ecm-user.service.mock.ts diff --git a/lib/content-services/src/lib/common/mocks/ecm-user.service.mock.ts b/lib/content-services/src/lib/common/mocks/ecm-user.service.mock.ts deleted file mode 100644 index f778cb91a7..0000000000 --- a/lib/content-services/src/lib/common/mocks/ecm-user.service.mock.ts +++ /dev/null @@ -1,39 +0,0 @@ -/*! - * @license - * Copyright © 2005-2025 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 { Person } from '@alfresco/js-api'; - -export const fakeEcmUser: Person = { - id: 'fake-id', - firstName: 'fake-ecm-first-name', - lastName: 'fake-ecm-last-name', - description: 'i am a fake user for test', - avatarId: 'fake-avatar-id', - email: 'fakeEcm@ecmUser.com', - skypeId: 'fake-skype-id', - googleId: 'fake-googleId-id', - instantMessageId: 'fake-instantMessageId-id', - company: null, - jobTitle: 'job-ecm-test', - location: 'fake location', - mobile: '000000000', - telephone: '11111111', - statusUpdatedAt: new Date(), - userStatus: 'active', - enabled: true, - emailNotificationsEnabled: true -}; diff --git a/lib/content-services/src/lib/common/public-api.ts b/lib/content-services/src/lib/common/public-api.ts index d66f9fcbd6..eb39528cf0 100644 --- a/lib/content-services/src/lib/common/public-api.ts +++ b/lib/content-services/src/lib/common/public-api.ts @@ -41,4 +41,3 @@ export * from './models/allowable-operations.enum'; export * from './interfaces/search-configuration.interface'; export * from './interfaces/saved-search.interface'; export * from './interfaces/saved-searches-strategy.interface'; -export * from './mocks/ecm-user.service.mock'; diff --git a/lib/content-services/src/lib/common/services/people-content.service.spec.ts b/lib/content-services/src/lib/common/services/people-content.service.spec.ts index fbe33c6bcc..146182224c 100644 --- a/lib/content-services/src/lib/common/services/people-content.service.spec.ts +++ b/lib/content-services/src/lib/common/services/people-content.service.spec.ts @@ -15,17 +15,37 @@ * limitations under the License. */ -import { fakeEcmUser } from '../mocks/ecm-user.service.mock'; import { RedirectAuthService } from '@alfresco/adf-core'; import { PeopleContentQueryRequestModel, PeopleContentService } from './people-content.service'; import { TestBed } from '@angular/core/testing'; -import { PersonPaging } from '@alfresco/js-api'; +import { Person, PersonPaging } from '@alfresco/js-api'; import { provideHttpClient } from '@angular/common/http'; import { provideHttpClientTesting } from '@angular/common/http/testing'; import { EMPTY, firstValueFrom, of } from 'rxjs'; import { AlfrescoApiService } from '../../services'; import { AlfrescoApiServiceMock } from '../../mock'; +const fakeEcmUser: Person = { + id: 'fake-id', + firstName: 'fake-ecm-first-name', + lastName: 'fake-ecm-last-name', + description: 'i am a fake user for test', + avatarId: 'fake-avatar-id', + email: 'fakeEcm@ecmUser.com', + skypeId: 'fake-skype-id', + googleId: 'fake-googleId-id', + instantMessageId: 'fake-instantMessageId-id', + company: null, + jobTitle: 'job-ecm-test', + location: 'fake location', + mobile: '000000000', + telephone: '11111111', + statusUpdatedAt: new Date(), + userStatus: 'active', + enabled: true, + emailNotificationsEnabled: true +}; + export const fakeEcmUser2 = { id: 'another-fake-id', firstName: 'another-fake-first-name',