diff --git a/.changeset/mean-cups-invite.md b/.changeset/mean-cups-invite.md new file mode 100644 index 0000000000..ba82c66043 --- /dev/null +++ b/.changeset/mean-cups-invite.md @@ -0,0 +1,15 @@ +--- +'@backstage/plugin-api-docs': patch +'@backstage/plugin-auth-backend': patch +'@backstage/plugin-badges-backend': patch +'@backstage/plugin-catalog': patch +'@backstage/plugin-catalog-graph': patch +'@backstage/plugin-catalog-import': patch +'@backstage/plugin-catalog-react': patch +'@backstage/plugin-explore': patch +'@backstage/plugin-fossa': patch +'@backstage/plugin-scaffolder': patch +'@backstage/plugin-todo-backend': patch +--- + +Adapt to the new `CatalogApi.getLocationByRef` diff --git a/.changeset/unlucky-dodos-scream.md b/.changeset/unlucky-dodos-scream.md new file mode 100644 index 0000000000..c44c3c7032 --- /dev/null +++ b/.changeset/unlucky-dodos-scream.md @@ -0,0 +1,14 @@ +--- +'@backstage/catalog-client': minor +--- + +Removed `CatalogApi.geLocationByEntity` and `CatalogApi.getOriginLocationByEntity`, and replaced them with `CatalogApi.getLocationByRef`. + +If you were using one of the two old methods, you can update your code as follows: + +```diff +-const originLocation = catalogApi.getOriginLocationByEntity(entity); ++const originLocation = catalogApi.getLocationByRef(entity.metadata.annotations[ANNOTATION_ORIGIN_LOCATION]!); +-const location = catalogApi.getLocationByEntity(entity); ++const location = catalogApi.getLocationByRef(entity.metadata.annotations[ANNOTATION_LOCATION]!); +``` diff --git a/packages/catalog-client/api-report.md b/packages/catalog-client/api-report.md index 090a1dbcc4..7427bdd235 100644 --- a/packages/catalog-client/api-report.md +++ b/packages/catalog-client/api-report.md @@ -43,16 +43,12 @@ export interface CatalogApi { name: EntityName, options?: CatalogRequestOptions, ): Promise; - getLocationByEntity( - entity: Entity, - options?: CatalogRequestOptions, - ): Promise; getLocationById( id: string, options?: CatalogRequestOptions, ): Promise; - getOriginLocationByEntity( - entity: Entity, + getLocationByRef( + locationRef: string, options?: CatalogRequestOptions, ): Promise; refreshEntity( @@ -95,16 +91,12 @@ export class CatalogClient implements CatalogApi { compoundName: EntityName, options?: CatalogRequestOptions, ): Promise; - getLocationByEntity( - entity: Entity, - options?: CatalogRequestOptions, - ): Promise; getLocationById( id: string, options?: CatalogRequestOptions, ): Promise; - getOriginLocationByEntity( - entity: Entity, + getLocationByRef( + locationRef: string, options?: CatalogRequestOptions, ): Promise; refreshEntity( diff --git a/packages/catalog-client/src/CatalogClient.ts b/packages/catalog-client/src/CatalogClient.ts index bcf8750658..84d5d02232 100644 --- a/packages/catalog-client/src/CatalogClient.ts +++ b/packages/catalog-client/src/CatalogClient.ts @@ -15,8 +15,6 @@ */ import { - ANNOTATION_LOCATION, - ANNOTATION_ORIGIN_LOCATION, Entity, EntityName, parseEntityRef, @@ -246,17 +244,12 @@ export class CatalogClient implements CatalogApi { } /** - * {@inheritdoc CatalogApi.getOriginLocationByEntity} + * {@inheritdoc CatalogApi.getLocationByRef} */ - async getOriginLocationByEntity( - entity: Entity, + async getLocationByRef( + locationRef: string, options?: CatalogRequestOptions, ): Promise { - const locationCompound = - entity.metadata.annotations?.[ANNOTATION_ORIGIN_LOCATION]; - if (!locationCompound) { - return undefined; - } const all: { data: Location }[] = await this.requestRequired( 'GET', '/locations', @@ -264,28 +257,7 @@ export class CatalogClient implements CatalogApi { ); return all .map(r => r.data) - .find(l => locationCompound === stringifyLocationRef(l)); - } - - /** - * {@inheritdoc CatalogApi.getLocationByEntity} - */ - async getLocationByEntity( - entity: Entity, - options?: CatalogRequestOptions, - ): Promise { - const locationCompound = entity.metadata.annotations?.[ANNOTATION_LOCATION]; - if (!locationCompound) { - return undefined; - } - const all: { data: Location }[] = await this.requestRequired( - 'GET', - '/locations', - options, - ); - return all - .map(r => r.data) - .find(l => locationCompound === stringifyLocationRef(l)); + .find(l => locationRef === stringifyLocationRef(l)); } /** diff --git a/packages/catalog-client/src/types/api.ts b/packages/catalog-client/src/types/api.ts index bf5a7327c6..b3d4bc2397 100644 --- a/packages/catalog-client/src/types/api.ts +++ b/packages/catalog-client/src/types/api.ts @@ -262,24 +262,13 @@ export interface CatalogApi { ): Promise; /** - * Gets origin location by Entity. + * Gets a registered location by its ref. * - * @param entity - An {@link catalog-model#Entity}. + * @param locationRef - A location ref, e.g. "url:https://github.com/..." * @param options - Additional options */ - getOriginLocationByEntity( - entity: Entity, - options?: CatalogRequestOptions, - ): Promise; - - /** - * Gets Location by Entity. - * - * @param entity - An {@link catalog-model#Entity}. - * @param options - Additional options - */ - getLocationByEntity( - entity: Entity, + getLocationByRef( + locationRef: string, options?: CatalogRequestOptions, ): Promise; diff --git a/plugins/api-docs/src/components/ApiExplorerPage/DefaultApiExplorerPage.test.tsx b/plugins/api-docs/src/components/ApiExplorerPage/DefaultApiExplorerPage.test.tsx index 9e4c861e24..9b79263b5f 100644 --- a/plugins/api-docs/src/components/ApiExplorerPage/DefaultApiExplorerPage.test.tsx +++ b/plugins/api-docs/src/components/ApiExplorerPage/DefaultApiExplorerPage.test.tsx @@ -56,7 +56,7 @@ describe('DefaultApiExplorerPage', () => { }, ] as Entity[], }), - getLocationByEntity: () => + getLocationByRef: () => Promise.resolve({ id: 'id', type: 'github', target: 'url' }), getEntityByName: async entityName => { return { diff --git a/plugins/api-docs/src/components/ApisCards/ConsumedApisCard.test.tsx b/plugins/api-docs/src/components/ApisCards/ConsumedApisCard.test.tsx index 5e7b22524a..d04a36770d 100644 --- a/plugins/api-docs/src/components/ApisCards/ConsumedApisCard.test.tsx +++ b/plugins/api-docs/src/components/ApisCards/ConsumedApisCard.test.tsx @@ -36,7 +36,7 @@ describe('', () => { getEntityByName: jest.fn(), getEntities: jest.fn(), addLocation: jest.fn(), - getLocationByEntity: jest.fn(), + getLocationByRef: jest.fn(), removeEntityByUid: jest.fn(), } as any; let Wrapper: React.ComponentType; diff --git a/plugins/api-docs/src/components/ApisCards/HasApisCard.test.tsx b/plugins/api-docs/src/components/ApisCards/HasApisCard.test.tsx index 4102bebf0e..050eeb8707 100644 --- a/plugins/api-docs/src/components/ApisCards/HasApisCard.test.tsx +++ b/plugins/api-docs/src/components/ApisCards/HasApisCard.test.tsx @@ -36,7 +36,7 @@ describe('', () => { getEntityByName: jest.fn(), getEntities: jest.fn(), addLocation: jest.fn(), - getLocationByEntity: jest.fn(), + getLocationByRef: jest.fn(), removeEntityByUid: jest.fn(), } as any; let Wrapper: React.ComponentType; diff --git a/plugins/api-docs/src/components/ApisCards/ProvidedApisCard.test.tsx b/plugins/api-docs/src/components/ApisCards/ProvidedApisCard.test.tsx index b29075aee9..34043c519b 100644 --- a/plugins/api-docs/src/components/ApisCards/ProvidedApisCard.test.tsx +++ b/plugins/api-docs/src/components/ApisCards/ProvidedApisCard.test.tsx @@ -36,7 +36,7 @@ describe('', () => { getEntityByName: jest.fn(), getEntities: jest.fn(), addLocation: jest.fn(), - getLocationByEntity: jest.fn(), + getLocationByRef: jest.fn(), removeEntityByUid: jest.fn(), } as any; let Wrapper: React.ComponentType; diff --git a/plugins/api-docs/src/components/ComponentsCards/ConsumingComponentsCard.test.tsx b/plugins/api-docs/src/components/ComponentsCards/ConsumingComponentsCard.test.tsx index 06022eec69..c81b4750bc 100644 --- a/plugins/api-docs/src/components/ComponentsCards/ConsumingComponentsCard.test.tsx +++ b/plugins/api-docs/src/components/ComponentsCards/ConsumingComponentsCard.test.tsx @@ -32,7 +32,7 @@ describe('', () => { getEntityByName: jest.fn(), getEntities: jest.fn(), addLocation: jest.fn(), - getLocationByEntity: jest.fn(), + getLocationByRef: jest.fn(), removeEntityByUid: jest.fn(), } as any; let Wrapper: React.ComponentType; diff --git a/plugins/api-docs/src/components/ComponentsCards/ProvidingComponentsCard.test.tsx b/plugins/api-docs/src/components/ComponentsCards/ProvidingComponentsCard.test.tsx index 275338d2f9..84e45dc058 100644 --- a/plugins/api-docs/src/components/ComponentsCards/ProvidingComponentsCard.test.tsx +++ b/plugins/api-docs/src/components/ComponentsCards/ProvidingComponentsCard.test.tsx @@ -32,7 +32,7 @@ describe('', () => { getEntityByName: jest.fn(), getEntities: jest.fn(), addLocation: jest.fn(), - getLocationByEntity: jest.fn(), + getLocationByRef: jest.fn(), removeEntityByUid: jest.fn(), } as any; let Wrapper: React.ComponentType; diff --git a/plugins/auth-backend/src/lib/catalog/CatalogIdentityClient.test.ts b/plugins/auth-backend/src/lib/catalog/CatalogIdentityClient.test.ts index 897233294f..83ebb5de73 100644 --- a/plugins/auth-backend/src/lib/catalog/CatalogIdentityClient.test.ts +++ b/plugins/auth-backend/src/lib/catalog/CatalogIdentityClient.test.ts @@ -30,8 +30,7 @@ describe('CatalogIdentityClient', () => { getEntities: jest.fn(), addLocation: jest.fn(), removeLocationById: jest.fn(), - getOriginLocationByEntity: jest.fn(), - getLocationByEntity: jest.fn(), + getLocationByRef: jest.fn(), removeEntityByUid: jest.fn(), refreshEntity: jest.fn(), getEntityAncestors: jest.fn(), diff --git a/plugins/badges-backend/src/service/router.test.ts b/plugins/badges-backend/src/service/router.test.ts index 286a2335f1..4b0ae2a44a 100644 --- a/plugins/badges-backend/src/service/router.test.ts +++ b/plugins/badges-backend/src/service/router.test.ts @@ -61,8 +61,7 @@ describe('createRouter', () => { addLocation: jest.fn(), getEntities: jest.fn(), getEntityByName: jest.fn(), - getOriginLocationByEntity: jest.fn(), - getLocationByEntity: jest.fn(), + getLocationByRef: jest.fn(), getLocationById: jest.fn(), removeLocationById: jest.fn(), removeEntityByUid: jest.fn(), diff --git a/plugins/catalog-graph/src/components/CatalogGraphCard/CatalogGraphCard.test.tsx b/plugins/catalog-graph/src/components/CatalogGraphCard/CatalogGraphCard.test.tsx index 7209a516a5..0e2fa723dc 100644 --- a/plugins/catalog-graph/src/components/CatalogGraphCard/CatalogGraphCard.test.tsx +++ b/plugins/catalog-graph/src/components/CatalogGraphCard/CatalogGraphCard.test.tsx @@ -60,8 +60,7 @@ describe('', () => { getEntityByName: jest.fn(async _ => ({ ...entity, relations: [] })), removeEntityByUid: jest.fn(), getLocationById: jest.fn(), - getOriginLocationByEntity: jest.fn(), - getLocationByEntity: jest.fn(), + getLocationByRef: jest.fn(), addLocation: jest.fn(), removeLocationById: jest.fn(), refreshEntity: jest.fn(), diff --git a/plugins/catalog-graph/src/components/CatalogGraphPage/CatalogGraphPage.test.tsx b/plugins/catalog-graph/src/components/CatalogGraphPage/CatalogGraphPage.test.tsx index 4c7a64a7ce..c509abd712 100644 --- a/plugins/catalog-graph/src/components/CatalogGraphPage/CatalogGraphPage.test.tsx +++ b/plugins/catalog-graph/src/components/CatalogGraphPage/CatalogGraphPage.test.tsx @@ -89,8 +89,7 @@ describe('', () => { getEntityByName: jest.fn(async n => (n.name === 'e' ? entityE : entityC)), removeEntityByUid: jest.fn(), getLocationById: jest.fn(), - getOriginLocationByEntity: jest.fn(), - getLocationByEntity: jest.fn(), + getLocationByRef: jest.fn(), addLocation: jest.fn(), removeLocationById: jest.fn(), refreshEntity: jest.fn(), diff --git a/plugins/catalog-graph/src/components/EntityRelationsGraph/EntityRelationsGraph.test.tsx b/plugins/catalog-graph/src/components/EntityRelationsGraph/EntityRelationsGraph.test.tsx index be0c4dc5e5..715f30e8c9 100644 --- a/plugins/catalog-graph/src/components/EntityRelationsGraph/EntityRelationsGraph.test.tsx +++ b/plugins/catalog-graph/src/components/EntityRelationsGraph/EntityRelationsGraph.test.tsx @@ -150,8 +150,7 @@ describe('', () => { getEntityByName: jest.fn(async n => entities[stringifyEntityRef(n)]), removeEntityByUid: jest.fn(), getLocationById: jest.fn(), - getOriginLocationByEntity: jest.fn(), - getLocationByEntity: jest.fn(), + getLocationByRef: jest.fn(), addLocation: jest.fn(), removeLocationById: jest.fn(), refreshEntity: jest.fn(), diff --git a/plugins/catalog-graph/src/components/EntityRelationsGraph/useEntityStore.test.ts b/plugins/catalog-graph/src/components/EntityRelationsGraph/useEntityStore.test.ts index a60750bab5..214f1a8fb9 100644 --- a/plugins/catalog-graph/src/components/EntityRelationsGraph/useEntityStore.test.ts +++ b/plugins/catalog-graph/src/components/EntityRelationsGraph/useEntityStore.test.ts @@ -32,8 +32,7 @@ describe('useEntityStore', () => { getEntityByName: jest.fn(), removeEntityByUid: jest.fn(), getLocationById: jest.fn(), - getOriginLocationByEntity: jest.fn(), - getLocationByEntity: jest.fn(), + getLocationByRef: jest.fn(), addLocation: jest.fn(), removeLocationById: jest.fn(), refreshEntity: jest.fn(), diff --git a/plugins/catalog-import/src/api/CatalogImportClient.test.ts b/plugins/catalog-import/src/api/CatalogImportClient.test.ts index fa63825af1..d2c7771804 100644 --- a/plugins/catalog-import/src/api/CatalogImportClient.test.ts +++ b/plugins/catalog-import/src/api/CatalogImportClient.test.ts @@ -94,8 +94,7 @@ describe('CatalogImportClient', () => { addLocation: jest.fn(), removeLocationById: jest.fn(), getEntityByName: jest.fn(), - getOriginLocationByEntity: jest.fn(), - getLocationByEntity: jest.fn(), + getLocationByRef: jest.fn(), getLocationById: jest.fn(), removeEntityByUid: jest.fn(), refreshEntity: jest.fn(), diff --git a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.test.tsx b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.test.tsx index 8d26657bb3..40c1152fe8 100644 --- a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.test.tsx +++ b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.test.tsx @@ -39,8 +39,7 @@ describe('', () => { getEntities: jest.fn(), addLocation: jest.fn(), getEntityByName: jest.fn(), - getOriginLocationByEntity: jest.fn(), - getLocationByEntity: jest.fn(), + getLocationByRef: jest.fn(), getLocationById: jest.fn(), removeLocationById: jest.fn(), removeEntityByUid: jest.fn(), diff --git a/plugins/catalog-react/src/components/UnregisterEntityDialog/useUnregisterEntityDialogState.test.tsx b/plugins/catalog-react/src/components/UnregisterEntityDialog/useUnregisterEntityDialogState.test.tsx index 44fc3886ea..25af7564d1 100644 --- a/plugins/catalog-react/src/components/UnregisterEntityDialog/useUnregisterEntityDialogState.test.tsx +++ b/plugins/catalog-react/src/components/UnregisterEntityDialog/useUnregisterEntityDialogState.test.tsx @@ -39,7 +39,7 @@ function defer(): { promise: Promise; resolve: (value: T) => void } { describe('useUnregisterEntityDialogState', () => { const catalogApiMock = { - getOriginLocationByEntity: jest.fn(), + getLocationByRef: jest.fn(), getEntities: jest.fn(), removeLocationById: jest.fn(), removeEntityByUid: jest.fn(), @@ -65,9 +65,7 @@ describe('useUnregisterEntityDialogState', () => { resolveLocation = deferredLocation.resolve; resolveColocatedEntities = deferredColocatedEntities.resolve; - catalogApiMock.getOriginLocationByEntity.mockReturnValue( - deferredLocation.promise, - ); + catalogApiMock.getLocationByRef.mockReturnValue(deferredLocation.promise); catalogApiMock.getEntities.mockReturnValue( deferredColocatedEntities.promise.then(items => ({ items })), ); diff --git a/plugins/catalog-react/src/components/UnregisterEntityDialog/useUnregisterEntityDialogState.ts b/plugins/catalog-react/src/components/UnregisterEntityDialog/useUnregisterEntityDialogState.ts index c637490268..6420ebd5ae 100644 --- a/plugins/catalog-react/src/components/UnregisterEntityDialog/useUnregisterEntityDialogState.ts +++ b/plugins/catalog-react/src/components/UnregisterEntityDialog/useUnregisterEntityDialogState.ts @@ -67,7 +67,7 @@ export function useUnregisterEntityDialogState( // Load the prerequisite data: what entities that are colocated with us, and // what location that spawned us const prerequisites = useAsync(async () => { - const locationPromise = catalogApi.getOriginLocationByEntity(entity); + const locationPromise = catalogApi.getLocationByRef(locationRef!); let colocatedEntitiesPromise: Promise; if (!locationRef) { diff --git a/plugins/catalog/src/components/AboutCard/AboutCard.test.tsx b/plugins/catalog/src/components/AboutCard/AboutCard.test.tsx index 4ef97b3d46..74c6490534 100644 --- a/plugins/catalog/src/components/AboutCard/AboutCard.test.tsx +++ b/plugins/catalog/src/components/AboutCard/AboutCard.test.tsx @@ -38,7 +38,7 @@ describe('', () => { getEntityByName: jest.fn(), getEntities: jest.fn(), addLocation: jest.fn(), - getLocationByEntity: jest.fn(), + getLocationByRef: jest.fn(), removeEntityByUid: jest.fn(), refreshEntity: jest.fn(), } as any; diff --git a/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.test.tsx b/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.test.tsx index 20acff3c50..c6a108ffc1 100644 --- a/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.test.tsx +++ b/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.test.tsx @@ -100,7 +100,7 @@ describe('DefaultCatalogPage', () => { }, ] as Entity[], }), - getLocationByEntity: () => + getLocationByRef: () => Promise.resolve({ id: 'id', type: 'github', target: 'url' }), getEntityByName: async entityName => { return { diff --git a/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.test.tsx b/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.test.tsx index d10c262357..db59e28f40 100644 --- a/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.test.tsx +++ b/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.test.tsx @@ -24,8 +24,7 @@ describe('', () => { const catalogApi: jest.Mocked = { addLocation: jest.fn(_a => new Promise(() => {})), getEntities: jest.fn(), - getOriginLocationByEntity: jest.fn(), - getLocationByEntity: jest.fn(), + getLocationByRef: jest.fn(), getLocationById: jest.fn(), removeLocationById: jest.fn(), removeEntityByUid: jest.fn(), diff --git a/plugins/explore/src/components/DomainExplorerContent/DomainExplorerContent.test.tsx b/plugins/explore/src/components/DomainExplorerContent/DomainExplorerContent.test.tsx index e36bd4ddb9..c431bd0c6c 100644 --- a/plugins/explore/src/components/DomainExplorerContent/DomainExplorerContent.test.tsx +++ b/plugins/explore/src/components/DomainExplorerContent/DomainExplorerContent.test.tsx @@ -25,8 +25,7 @@ describe('', () => { const catalogApi: jest.Mocked = { addLocation: jest.fn(_a => new Promise(() => {})), getEntities: jest.fn(), - getOriginLocationByEntity: jest.fn(), - getLocationByEntity: jest.fn(), + getLocationByRef: jest.fn(), getLocationById: jest.fn(), removeLocationById: jest.fn(), removeEntityByUid: jest.fn(), diff --git a/plugins/explore/src/components/GroupsExplorerContent/GroupsExplorerContent.test.tsx b/plugins/explore/src/components/GroupsExplorerContent/GroupsExplorerContent.test.tsx index 5d3f7c358b..23ae2a3e6d 100644 --- a/plugins/explore/src/components/GroupsExplorerContent/GroupsExplorerContent.test.tsx +++ b/plugins/explore/src/components/GroupsExplorerContent/GroupsExplorerContent.test.tsx @@ -25,8 +25,7 @@ describe('', () => { const catalogApi: jest.Mocked = { addLocation: jest.fn(_a => new Promise(() => {})), getEntities: jest.fn(), - getOriginLocationByEntity: jest.fn(), - getLocationByEntity: jest.fn(), + getLocationByRef: jest.fn(), getLocationById: jest.fn(), removeLocationById: jest.fn(), removeEntityByUid: jest.fn(), diff --git a/plugins/fossa/src/components/FossaPage/FossaPage.test.tsx b/plugins/fossa/src/components/FossaPage/FossaPage.test.tsx index 421ff4431f..df376895bc 100644 --- a/plugins/fossa/src/components/FossaPage/FossaPage.test.tsx +++ b/plugins/fossa/src/components/FossaPage/FossaPage.test.tsx @@ -30,9 +30,8 @@ describe('', () => { addLocation: jest.fn(), getEntities: jest.fn(), getEntityByName: jest.fn(), - getLocationByEntity: jest.fn(), + getLocationByRef: jest.fn(), getLocationById: jest.fn(), - getOriginLocationByEntity: jest.fn(), removeEntityByUid: jest.fn(), removeLocationById: jest.fn(), refreshEntity: jest.fn(), diff --git a/plugins/scaffolder/src/components/fields/EntityPicker/EntityPicker.test.tsx b/plugins/scaffolder/src/components/fields/EntityPicker/EntityPicker.test.tsx index 3dc609a63b..82f12ac0a3 100644 --- a/plugins/scaffolder/src/components/fields/EntityPicker/EntityPicker.test.tsx +++ b/plugins/scaffolder/src/components/fields/EntityPicker/EntityPicker.test.tsx @@ -46,7 +46,7 @@ describe('', () => { getEntityByName: jest.fn(), getEntities: jest.fn(async () => ({ items: entities })), addLocation: jest.fn(), - getLocationByEntity: jest.fn(), + getLocationByRef: jest.fn(), removeEntityByUid: jest.fn(), } as any; let Wrapper: React.ComponentType; diff --git a/plugins/scaffolder/src/components/fields/OwnerPicker/OwnerPicker.test.tsx b/plugins/scaffolder/src/components/fields/OwnerPicker/OwnerPicker.test.tsx index 31992fbc8a..b78d3add9e 100644 --- a/plugins/scaffolder/src/components/fields/OwnerPicker/OwnerPicker.test.tsx +++ b/plugins/scaffolder/src/components/fields/OwnerPicker/OwnerPicker.test.tsx @@ -43,7 +43,7 @@ describe('', () => { getEntityByName: jest.fn(), getEntities: jest.fn(async () => ({ items: entities })), addLocation: jest.fn(), - getLocationByEntity: jest.fn(), + getLocationByRef: jest.fn(), removeEntityByUid: jest.fn(), } as any; let Wrapper: React.ComponentType; diff --git a/plugins/todo-backend/src/service/TodoReaderService.test.ts b/plugins/todo-backend/src/service/TodoReaderService.test.ts index ce1c61d8a5..fbb1341e73 100644 --- a/plugins/todo-backend/src/service/TodoReaderService.test.ts +++ b/plugins/todo-backend/src/service/TodoReaderService.test.ts @@ -45,8 +45,7 @@ function mockCatalogClient(entity?: Entity): jest.Mocked { addLocation: jest.fn(), getEntities: jest.fn(), getEntityByName: jest.fn(), - getOriginLocationByEntity: jest.fn(), - getLocationByEntity: jest.fn(), + getLocationByRef: jest.fn(), getLocationById: jest.fn(), removeLocationById: jest.fn(), removeEntityByUid: jest.fn(),