diff --git a/src/app/core/cache/builders/link.service.spec.ts b/src/app/core/cache/builders/link.service.spec.ts index a09adea8f7..96650f1a55 100644 --- a/src/app/core/cache/builders/link.service.spec.ts +++ b/src/app/core/cache/builders/link.service.spec.ts @@ -1,18 +1,13 @@ /* eslint-disable max-classes-per-file */ -import { Injectable } from '@angular/core'; import { TestBed } from '@angular/core/testing'; -import { of } from 'rxjs'; import { isEmpty, take, } from 'rxjs/operators'; import { APP_DATA_SERVICES_MAP } from '../../../../config/app-config.interface'; -import { - followLink, - FollowLinkConfig, -} from '../../../shared/utils/follow-link-config.model'; -import { FindListOptions } from '../../data/find-list-options.model'; +import { TestDataService } from '../../../shared/testing/test-data-service.mock'; +import { followLink } from '../../../shared/utils/follow-link-config.model'; import { HALLink } from '../../shared/hal-link.model'; import { HALResource } from '../../shared/hal-resource.model'; import { ResourceType } from '../../shared/resource-type'; @@ -42,19 +37,8 @@ class TestModel implements HALResource { successor?: TestModel; } -@Injectable() -export class TestDataService { - findListByHref(href: string, findListOptions: FindListOptions = {}, useCachedVersionIfAvailable = true, reRequestOnStale = true, ...linksToFollow: FollowLinkConfig[]) { - return of('findListByHref'); - } - - findByHref(href: string, useCachedVersionIfAvailable = true, reRequestOnStale = true, ...linksToFollow: FollowLinkConfig[]) { - return of('findByHref'); - } -} - const mockDataServiceMap: any = { - [TEST_MODEL.value]: () => import('./link.service.spec').then(m => m.TestDataService), + [TEST_MODEL.value]: () => import('../../../shared/testing/test-data-service.mock').then(m => m.TestDataService), }; let testDataService: TestDataService; diff --git a/src/app/shared/testing/test-data-service.mock.ts b/src/app/shared/testing/test-data-service.mock.ts new file mode 100644 index 0000000000..dbb216ea57 --- /dev/null +++ b/src/app/shared/testing/test-data-service.mock.ts @@ -0,0 +1,16 @@ +import { Injectable } from '@angular/core'; +import { of } from 'rxjs'; + +import { FindListOptions } from '../../core/data/find-list-options.model'; +import { FollowLinkConfig } from '../utils/follow-link-config.model'; + +@Injectable() +export class TestDataService { + findListByHref(href: string, findListOptions: FindListOptions = {}, useCachedVersionIfAvailable = true, reRequestOnStale = true, ...linksToFollow: FollowLinkConfig[]) { + return of('findListByHref'); + } + + findByHref(href: string, useCachedVersionIfAvailable = true, reRequestOnStale = true, ...linksToFollow: FollowLinkConfig[]) { + return of('findByHref'); + } +}