From 523371d8a91cc5a570a96bcfd330c768792c10ec Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Fri, 16 Apr 2021 01:02:41 +0100 Subject: [PATCH] remove Signed-off-by: Andrew Johnson --- .../components/GithubDeploymentsCard.test.tsx | 19 ++++++++++++++----- .../GithubDeploymentsTable/columns.tsx | 10 ---------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/plugins/github-deployments/src/components/GithubDeploymentsCard.test.tsx b/plugins/github-deployments/src/components/GithubDeploymentsCard.test.tsx index 52c84d657b..f128e6274b 100644 --- a/plugins/github-deployments/src/components/GithubDeploymentsCard.test.tsx +++ b/plugins/github-deployments/src/components/GithubDeploymentsCard.test.tsx @@ -26,7 +26,11 @@ import { import { fireEvent } from '@testing-library/react'; import { msw, renderInTestApp } from '@backstage/test-utils'; -import { GithubDeploymentsApiClient, githubDeploymentsApiRef } from '../api'; +import { + GithubDeployment, + GithubDeploymentsApiClient, + githubDeploymentsApiRef, +} from '../api'; import { githubDeploymentsPlugin } from '../plugin'; import { GithubDeploymentsCard } from './GithubDeploymentsCard'; @@ -40,6 +44,7 @@ import { import { setupServer } from 'msw/node'; import { graphql } from 'msw'; import { GithubDeploymentsTable } from './GithubDeploymentsTable'; +import { Box } from '@material-ui/core'; jest.mock('@backstage/plugin-catalog-react', () => ({ useEntity: () => { @@ -173,12 +178,16 @@ describe('github-deployments', () => { return parsedPayload?.target || 'unknown'; }; + const extraColumn = { + title: 'Target', + render: (row: GithubDeployment): JSX.Element => ( + {renderTargetFromPayload(row.payload)} + ), + }; + const columns = [ ...GithubDeploymentsTable.defaultDeploymentColumns, - GithubDeploymentsTable.columns.createPayloadColumn( - 'Target', - renderTargetFromPayload, - ), + extraColumn, ]; const rendered = await renderInTestApp( diff --git a/plugins/github-deployments/src/components/GithubDeploymentsTable/columns.tsx b/plugins/github-deployments/src/components/GithubDeploymentsTable/columns.tsx index e1a9fc180b..94d60e9b5f 100644 --- a/plugins/github-deployments/src/components/GithubDeploymentsTable/columns.tsx +++ b/plugins/github-deployments/src/components/GithubDeploymentsTable/columns.tsx @@ -88,13 +88,3 @@ export function createLastUpdatedColumn(): TableColumn { ), }; } - -export function createCustomColumn( - title: string, - render: (payload: GithubDeployment) => JSX.Element, -): TableColumn { - return { - title: title, - render: (deployment: GithubDeployment) => render(deployment), - }; -}