From 7d922eb29697dba7bee56ca9b5d09126fa9dd169 Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Mon, 22 Mar 2021 21:49:31 -0400 Subject: [PATCH] Still broken tests Signed-off-by: Adam Harvey --- .../SystemDiagram/SystemDiagram.test.tsx | 41 +++++++++---------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/plugins/catalog/src/components/SystemDiagram/SystemDiagram.test.tsx b/plugins/catalog/src/components/SystemDiagram/SystemDiagram.test.tsx index 5cc29d63b0..bca8d97b05 100644 --- a/plugins/catalog/src/components/SystemDiagram/SystemDiagram.test.tsx +++ b/plugins/catalog/src/components/SystemDiagram/SystemDiagram.test.tsx @@ -15,16 +15,9 @@ */ import { ApiProvider, ApiRegistry } from '@backstage/core'; -import { - catalogApiRef, - CatalogApi, - getEntityRelations, - EntityProvider, -} from '@backstage/plugin-catalog-react'; -import { Entity, EntityName, RELATION_PART_OF } from '@backstage/catalog-model'; - +import { catalogApiRef, CatalogApi } from '@backstage/plugin-catalog-react'; +import { Entity, RELATION_PART_OF } from '@backstage/catalog-model'; import { renderInTestApp } from '@backstage/test-utils'; -import { waitFor } from '@testing-library/react'; import React from 'react'; import { SystemDiagram } from './SystemDiagram'; @@ -33,21 +26,23 @@ describe('', () => { getEntities: () => Promise.resolve({ items: [ - // { - // apiVersion: 'backstage.io/v1alpha1', - // kind: 'System', - // metadata: { - // name: 'my-system', - // }, - // spec: { - // owner: 'tools@example.com', - // }, - // }, + { + apiVersion: 'backstage.io/v1alpha1', + kind: 'System', + metadata: { + name: 'my-system', + namespace: 'my-namespace', + }, + spec: { + owner: 'tools@example.com', + }, + }, { apiVersion: 'backstage.io/v1alpha1', kind: 'Component', metadata: { name: 'Entity2', + namespace: 'my-namespace', }, spec: { owner: 'not-tools@example.com', @@ -57,6 +52,11 @@ describe('', () => { }, ] as Entity[], }), + // need to mock this? + // getEntityRelations: (Entity, string) => + // Promise.resolve({ + + // }), }; afterEach(() => jest.resetAllMocks()); @@ -67,7 +67,6 @@ describe('', () => { kind: 'System', metadata: { name: 'my-system', - // namespace: 'my-namespace', }, relations: [], }; @@ -79,7 +78,7 @@ describe('', () => { ); expect(getByText('System Diagram')).toBeInTheDocument(); - expect(getByText('my-system')).not.toBeInTheDocument(); + // expect(getByText('my-system')).not.toBeInTheDocument(); }); it('shows related systems', async () => {