From df3abef6400a34c12a3554b30a1e2ba0efbae92e Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Mon, 12 Jun 2023 11:45:41 +0200 Subject: [PATCH] api-docs: mock facets endpoint Signed-off-by: Vincenzo Scamporlino --- .../DefaultApiExplorerPage.test.tsx | 22 ++----------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/plugins/api-docs/src/components/ApiExplorerPage/DefaultApiExplorerPage.test.tsx b/plugins/api-docs/src/components/ApiExplorerPage/DefaultApiExplorerPage.test.tsx index f89897524d..d0c9e66d18 100644 --- a/plugins/api-docs/src/components/ApiExplorerPage/DefaultApiExplorerPage.test.tsx +++ b/plugins/api-docs/src/components/ApiExplorerPage/DefaultApiExplorerPage.test.tsx @@ -14,11 +14,6 @@ * limitations under the License. */ -import { - Entity, - parseEntityRef, - RELATION_MEMBER_OF, -} from '@backstage/catalog-model'; import { ConfigReader } from '@backstage/core-app-api'; import { TableColumn, TableProps } from '@backstage/core-components'; import { @@ -60,25 +55,12 @@ describe('DefaultApiExplorerPage', () => { }, spec: { type: 'openapi' }, }, - ] as Entity[], + ], }), getLocationByRef: () => Promise.resolve({ id: 'id', type: 'url', target: 'url' }), getEntitiesByRefs: () => Promise.resolve({ items: [] }), - getEntityByRef: async entityRef => { - return { - apiVersion: 'backstage.io/v1alpha1', - kind: 'User', - metadata: { name: parseEntityRef(entityRef).name }, - relations: [ - { - type: RELATION_MEMBER_OF, - targetRef: 'group:default/tools', - target: { namespace: 'default', kind: 'group', name: 'tools' }, - }, - ], - }; - }, + getEntityFacets: async () => ({ facets: { 'relations.ownedBy': [] } }), }; const configApi: ConfigApi = new ConfigReader({