From 1ffb9f36e9e32a5645f0fb6bf79edd8eb51766cd Mon Sep 17 00:00:00 2001 From: Tyler Davis Date: Thu, 12 Dec 2024 18:36:18 +1100 Subject: [PATCH] Properly capitalize Kind facet in CatalogTable title Signed-off-by: Tyler Davis --- .changeset/blue-bobcats-hear.md | 5 ++ .changeset/gorgeous-glasses-sin.md | 6 +++ .changeset/stale-actors-sin.md | 5 ++ plugins/catalog-react/report.api.md | 4 +- .../EntityAutocompletePicker.test.tsx | 8 +-- .../EntityKindPicker.test.tsx | 12 +++-- .../EntityKindPicker/EntityKindPicker.tsx | 19 ++++--- .../EntityKindPicker/kindFilterUtils.ts | 50 ++++++++----------- .../EntityTypePicker.test.tsx | 6 ++- .../UserListPicker/UserListPicker.test.tsx | 10 ++-- plugins/catalog-react/src/filters.ts | 2 +- .../src/hooks/useEntityListProvider.test.tsx | 26 +++++++--- .../CatalogKindHeader.test.tsx | 8 +-- .../CatalogKindHeader/CatalogKindHeader.tsx | 13 +++-- .../CatalogKindHeader/kindFilterUtils.ts | 50 ++++++++----------- .../CatalogTable/CatalogTable.test.tsx | 8 ++- .../components/CatalogTable/CatalogTable.tsx | 2 +- .../CursorPaginatedCatalogTable.test.tsx | 2 +- .../TemplateTypePicker.test.tsx | 4 +- .../Tables/CursorPaginatedDocsTable.test.tsx | 2 +- 20 files changed, 135 insertions(+), 107 deletions(-) create mode 100644 .changeset/blue-bobcats-hear.md create mode 100644 .changeset/gorgeous-glasses-sin.md create mode 100644 .changeset/stale-actors-sin.md diff --git a/.changeset/blue-bobcats-hear.md b/.changeset/blue-bobcats-hear.md new file mode 100644 index 0000000000..4d28dc3e5c --- /dev/null +++ b/.changeset/blue-bobcats-hear.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-react': minor +--- + +Update `EntityKindFilter` to include a `label` field with the properly capitalized Kind facet string diff --git a/.changeset/gorgeous-glasses-sin.md b/.changeset/gorgeous-glasses-sin.md new file mode 100644 index 0000000000..1dc737c79b --- /dev/null +++ b/.changeset/gorgeous-glasses-sin.md @@ -0,0 +1,6 @@ +--- +'@backstage/plugin-scaffolder': patch +'@backstage/plugin-techdocs': patch +--- + +Update tests that utilize `EntityKindFilter` to pass the new required `label` parameter diff --git a/.changeset/stale-actors-sin.md b/.changeset/stale-actors-sin.md new file mode 100644 index 0000000000..e095c3ed25 --- /dev/null +++ b/.changeset/stale-actors-sin.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog': minor +--- + +Update `CatalogTable` title to use properly capitalized Kind facets (e.g. 'Component' instead of 'component') diff --git a/plugins/catalog-react/report.api.md b/plugins/catalog-react/report.api.md index af5102176d..1e637f79a5 100644 --- a/plugins/catalog-react/report.api.md +++ b/plugins/catalog-react/report.api.md @@ -243,10 +243,12 @@ export type EntityFilter = { // @public export class EntityKindFilter implements EntityFilter { - constructor(value: string); + constructor(value: string, label: string); // (undocumented) getCatalogFilters(): Record; // (undocumented) + readonly label: string; + // (undocumented) toQueryValue(): string; // (undocumented) readonly value: string; diff --git a/plugins/catalog-react/src/components/EntityAutocompletePicker/EntityAutocompletePicker.test.tsx b/plugins/catalog-react/src/components/EntityAutocompletePicker/EntityAutocompletePicker.test.tsx index 449a8d434a..f025c14011 100644 --- a/plugins/catalog-react/src/components/EntityAutocompletePicker/EntityAutocompletePicker.test.tsx +++ b/plugins/catalog-react/src/components/EntityAutocompletePicker/EntityAutocompletePicker.test.tsx @@ -335,7 +335,7 @@ describe('', () => { ', () => { expect(mockCatalogApi.getEntityFacets).toHaveBeenCalledWith({ facets: ['spec.options'], filter: { - kind: 'Component', + kind: 'component', }, }), ); @@ -367,7 +367,7 @@ describe('', () => { ', () => { expect(mockCatalogApi.getEntityFacets).toHaveBeenCalledWith({ facets: ['spec.options'], filter: { - kind: 'Component', + kind: 'component', 'spec.type': ['service'], }, }), diff --git a/plugins/catalog-react/src/components/EntityKindPicker/EntityKindPicker.test.tsx b/plugins/catalog-react/src/components/EntityKindPicker/EntityKindPicker.test.tsx index 4633862f2c..5d74477d10 100644 --- a/plugins/catalog-react/src/components/EntityKindPicker/EntityKindPicker.test.tsx +++ b/plugins/catalog-react/src/components/EntityKindPicker/EntityKindPicker.test.tsx @@ -78,7 +78,9 @@ describe('', () => { await renderInTestApp( @@ -106,7 +108,7 @@ describe('', () => { @@ -121,7 +123,7 @@ describe('', () => { fireEvent.click(screen.getByText('Domain')); expect(updateFilters).toHaveBeenLastCalledWith({ - kind: new EntityKindFilter('domain'), + kind: new EntityKindFilter('domain', 'Domain'), }); }); @@ -143,7 +145,7 @@ describe('', () => { ); expect(updateFilters).toHaveBeenLastCalledWith({ - kind: new EntityKindFilter('group'), + kind: new EntityKindFilter('group', 'Group'), }); }); @@ -173,6 +175,8 @@ describe('', () => { const input = screen.getByTestId('select'); fireEvent.mouseDown(within(input).getByRole('button')); + // screen.debug(); + expect( screen.getByRole('option', { name: 'Component' }), ).toBeInTheDocument(); diff --git a/plugins/catalog-react/src/components/EntityKindPicker/EntityKindPicker.tsx b/plugins/catalog-react/src/components/EntityKindPicker/EntityKindPicker.tsx index 0874252c3a..bdfd3276ef 100644 --- a/plugins/catalog-react/src/components/EntityKindPicker/EntityKindPicker.tsx +++ b/plugins/catalog-react/src/components/EntityKindPicker/EntityKindPicker.tsx @@ -27,7 +27,7 @@ import { useTranslationRef } from '@backstage/core-plugin-api/alpha'; function useEntityKindFilter(opts: { initialFilter: string }): { loading: boolean; error?: Error; - allKinds: string[]; + allKinds: Map; selectedKind: string; setSelectedKind: (kind: string) => void; } { @@ -62,18 +62,21 @@ function useEntityKindFilter(opts: { initialFilter: string }): { } }, [filters.kind]); + const { allKinds, loading, error } = useAllKinds(); + const selectedKindLabel = allKinds.get(selectedKind) || selectedKind; + useEffect(() => { updateFilters({ - kind: selectedKind ? new EntityKindFilter(selectedKind) : undefined, + kind: selectedKind + ? new EntityKindFilter(selectedKind, selectedKindLabel) + : undefined, }); - }, [selectedKind, updateFilters]); - - const { allKinds, loading, error } = useAllKinds(); + }, [selectedKind, selectedKindLabel, updateFilters]); return { loading, error, - allKinds: allKinds ?? [], + allKinds, selectedKind, setSelectedKind, }; @@ -119,9 +122,9 @@ export const EntityKindPicker = (props: EntityKindPickerProps) => { const options = filterKinds(allKinds, allowedKinds, selectedKind); - const items = Object.keys(options).map(key => ({ + const items = [...options.entries()].map(([key, value]) => ({ + label: value, value: key, - label: options[key], })); return hidden ? null : ( diff --git a/plugins/catalog-react/src/components/EntityKindPicker/kindFilterUtils.ts b/plugins/catalog-react/src/components/EntityKindPicker/kindFilterUtils.ts index b3e27c85d9..2147dbd3b8 100644 --- a/plugins/catalog-react/src/components/EntityKindPicker/kindFilterUtils.ts +++ b/plugins/catalog-react/src/components/EntityKindPicker/kindFilterUtils.ts @@ -19,12 +19,12 @@ import useAsync from 'react-use/esm/useAsync'; import { catalogApiRef } from '../../api'; /** - * Fetch and return all availible kinds. + * Fetch and return all available kinds. */ export function useAllKinds(): { loading: boolean; error?: Error; - allKinds: string[]; + allKinds: Map; } { const catalogApi = useApi(catalogApiRef); @@ -33,50 +33,40 @@ export function useAllKinds(): { loading, value: allKinds, } = useAsync(async () => { - const items = await catalogApi - .getEntityFacets({ facets: ['kind'] }) - .then(response => response.facets.kind?.map(f => f.value).sort() || []); - return items; + const { facets } = await catalogApi.getEntityFacets({ facets: ['kind'] }); + const kindFacets = (facets.kind ?? []).map(f => f.value); + return new Map( + kindFacets.map(kind => [kind.toLocaleLowerCase('en-US'), kind]), + ); }, [catalogApi]); - return { loading, error, allKinds: allKinds ?? [] }; + return { loading, error, allKinds: allKinds ?? new Map() }; } /** * Filter and capitalize accessible kinds. */ export function filterKinds( - allKinds: string[], + allKinds: Map, allowedKinds?: string[], forcedKinds?: string, -): Record { +): Map { // Before allKinds is loaded, or when a kind is entered manually in the URL, selectedKind may not // be present in allKinds. It should still be shown in the dropdown, but may not have the nice // enforced casing from the catalog-backend. This makes a key/value record for the Select options, // including selectedKind if it's unknown - but allows the selectedKind to get clobbered by the // more proper catalog kind if it exists. - let availableKinds = allKinds; - if (allowedKinds) { - availableKinds = availableKinds.filter(k => - allowedKinds.some( - a => a.toLocaleLowerCase('en-US') === k.toLocaleLowerCase('en-US'), - ), - ); - } - if ( - forcedKinds && - !allKinds.some( - a => - a.toLocaleLowerCase('en-US') === forcedKinds.toLocaleLowerCase('en-US'), - ) - ) { - availableKinds = availableKinds.concat([forcedKinds]); - } + const desiredKinds = allowedKinds + ? allowedKinds.map(k => k.toLocaleLowerCase('en-US')) + : Array.from(allKinds.keys()); - const kindsMap = availableKinds.sort().reduce((acc, kind) => { - acc[kind.toLocaleLowerCase('en-US')] = kind; - return acc; - }, {} as Record); + const kindsMap = new Map( + desiredKinds.map(kind => [kind, allKinds.get(kind) || kind]), + ); + + if (forcedKinds && !kindsMap.has(forcedKinds)) { + kindsMap.set(forcedKinds.toLocaleLowerCase('en-US'), forcedKinds); + } return kindsMap; } diff --git a/plugins/catalog-react/src/components/EntityTypePicker/EntityTypePicker.test.tsx b/plugins/catalog-react/src/components/EntityTypePicker/EntityTypePicker.test.tsx index f7954f2604..75c83e4b86 100644 --- a/plugins/catalog-react/src/components/EntityTypePicker/EntityTypePicker.test.tsx +++ b/plugins/catalog-react/src/components/EntityTypePicker/EntityTypePicker.test.tsx @@ -86,7 +86,9 @@ describe('', () => { await renderInTestApp( @@ -110,7 +112,7 @@ describe('', () => { diff --git a/plugins/catalog-react/src/components/UserListPicker/UserListPicker.test.tsx b/plugins/catalog-react/src/components/UserListPicker/UserListPicker.test.tsx index 3ef5c242a1..92b51786d0 100644 --- a/plugins/catalog-react/src/components/UserListPicker/UserListPicker.test.tsx +++ b/plugins/catalog-react/src/components/UserListPicker/UserListPicker.test.tsx @@ -252,7 +252,7 @@ describe('', () => { value={{ updateFilters, queryParameters, - filters: { kind: new EntityKindFilter('component') }, + filters: { kind: new EntityKindFilter('component', 'Component') }, }} > @@ -293,7 +293,7 @@ describe('', () => { @@ -341,7 +341,7 @@ describe('', () => { updateFilters, queryParameters: { user: ['all'], kind: 'component' }, filters: { - kind: new EntityKindFilter('component'), + kind: new EntityKindFilter('component', 'Component'), user: undefined, }, }} @@ -368,7 +368,7 @@ describe('', () => { updateFilters, queryParameters: { user: ['owned'], kind: 'component' }, filters: { - kind: new EntityKindFilter('component'), + kind: new EntityKindFilter('component', 'Component'), user: undefined, }, }} @@ -394,7 +394,7 @@ describe('', () => { value={{ updateFilters, filters: filters || { - kind: new EntityKindFilter('component'), + kind: new EntityKindFilter('component', 'Component'), }, }} > diff --git a/plugins/catalog-react/src/filters.ts b/plugins/catalog-react/src/filters.ts index 6c68dad9aa..1baa07da23 100644 --- a/plugins/catalog-react/src/filters.ts +++ b/plugins/catalog-react/src/filters.ts @@ -29,7 +29,7 @@ import { getEntityRelations } from './utils'; * @public */ export class EntityKindFilter implements EntityFilter { - constructor(readonly value: string) {} + constructor(readonly value: string, readonly label: string) {} getCatalogFilters(): Record { return { kind: this.value }; diff --git a/plugins/catalog-react/src/hooks/useEntityListProvider.test.tsx b/plugins/catalog-react/src/hooks/useEntityListProvider.test.tsx index 2ed944d339..8701c56301 100644 --- a/plugins/catalog-react/src/hooks/useEntityListProvider.test.tsx +++ b/plugins/catalog-react/src/hooks/useEntityListProvider.test.tsx @@ -87,7 +87,7 @@ const createWrapper = const { updateFilters } = useEntityList(); useMountEffect(() => { - updateFilters({ kind: new EntityKindFilter('component') }); + updateFilters({ kind: new EntityKindFilter('component', 'Component') }); }); return <>{children}; @@ -252,7 +252,9 @@ describe('', () => { expect(mockCatalogApi.getEntities).toHaveBeenCalledTimes(1); await act(async () => { - result.current.updateFilters({ kind: new EntityKindFilter('api') }); + result.current.updateFilters({ + kind: new EntityKindFilter('api', 'API'), + }); result.current.updateFilters({ type: new EntityTypeFilter('service') }); }); @@ -277,7 +279,9 @@ describe('', () => { mockCatalogApi.getEntities!.mockRejectedValueOnce('error'); act(() => { - result.current.updateFilters({ kind: new EntityKindFilter('api') }); + result.current.updateFilters({ + kind: new EntityKindFilter('api', 'API'), + }); }); await waitFor(() => { expect(result.current.error).toBeDefined(); @@ -443,7 +447,9 @@ describe('', () => { expect(mockCatalogApi.queryEntities).toHaveBeenCalledTimes(1); await act(async () => { - result.current.updateFilters({ kind: new EntityKindFilter('api') }); + result.current.updateFilters({ + kind: new EntityKindFilter('api', 'API'), + }); result.current.updateFilters({ type: new EntityTypeFilter('service') }); }); @@ -470,7 +476,9 @@ describe('', () => { mockCatalogApi.queryEntities!.mockRejectedValueOnce('error'); act(() => { - result.current.updateFilters({ kind: new EntityKindFilter('api') }); + result.current.updateFilters({ + kind: new EntityKindFilter('api', 'API'), + }); }); await waitFor(() => { expect(result.current.error).toBeDefined(); @@ -716,7 +724,9 @@ describe('', () => { expect(mockCatalogApi.queryEntities).toHaveBeenCalledTimes(1); await act(async () => { - result.current.updateFilters({ kind: new EntityKindFilter('api') }); + result.current.updateFilters({ + kind: new EntityKindFilter('api', 'API'), + }); result.current.updateFilters({ type: new EntityTypeFilter('service') }); }); @@ -768,7 +778,9 @@ describe('', () => { mockCatalogApi.queryEntities!.mockRejectedValueOnce('error'); act(() => { - result.current.updateFilters({ kind: new EntityKindFilter('api') }); + result.current.updateFilters({ + kind: new EntityKindFilter('api', 'API'), + }); }); await waitFor(() => { expect(result.current.error).toBeDefined(); diff --git a/plugins/catalog/src/components/CatalogKindHeader/CatalogKindHeader.test.tsx b/plugins/catalog/src/components/CatalogKindHeader/CatalogKindHeader.test.tsx index a169e9139a..d0e3fa9ace 100644 --- a/plugins/catalog/src/components/CatalogKindHeader/CatalogKindHeader.test.tsx +++ b/plugins/catalog/src/components/CatalogKindHeader/CatalogKindHeader.test.tsx @@ -133,7 +133,7 @@ describe('', () => { fireEvent.click(option); expect(updateFilters).toHaveBeenCalledWith({ - kind: new EntityKindFilter('template'), + kind: new EntityKindFilter('template', 'Template'), }); }); @@ -144,7 +144,7 @@ describe('', () => { @@ -152,7 +152,7 @@ describe('', () => { , ); expect(updateFilters).toHaveBeenLastCalledWith({ - kind: new EntityKindFilter('components'), + kind: new EntityKindFilter('component', 'Component'), }); rendered.rerender( @@ -168,7 +168,7 @@ describe('', () => { ); await waitFor(() => expect(updateFilters).toHaveBeenLastCalledWith({ - kind: new EntityKindFilter('template'), + kind: new EntityKindFilter('template', 'Template'), }), ); }); diff --git a/plugins/catalog/src/components/CatalogKindHeader/CatalogKindHeader.tsx b/plugins/catalog/src/components/CatalogKindHeader/CatalogKindHeader.tsx index 58fd0cfc0f..db4767a82a 100644 --- a/plugins/catalog/src/components/CatalogKindHeader/CatalogKindHeader.tsx +++ b/plugins/catalog/src/components/CatalogKindHeader/CatalogKindHeader.tsx @@ -91,11 +91,16 @@ export function CatalogKindHeader(props: CatalogKindHeaderProps) { } }, [filters.kind]); + const selectedKindLabel = + allKinds.get(selectedKind.toLocaleLowerCase('en-US')) || selectedKind; + useEffect(() => { updateFilters({ - kind: selectedKind ? new EntityKindFilter(selectedKind) : undefined, + kind: selectedKind + ? new EntityKindFilter(selectedKind, selectedKindLabel) + : undefined, }); - }, [selectedKind, updateFilters]); + }, [selectedKind, selectedKindLabel, updateFilters]); const options = filterKinds(allKinds, allowedKinds, selectedKind); @@ -106,9 +111,9 @@ export function CatalogKindHeader(props: CatalogKindHeaderProps) { onChange={e => setSelectedKind(e.target.value as string)} classes={classes} > - {Object.keys(options).map(kind => ( + {[...options.keys()].map(kind => ( - {`${pluralize(options[kind])}`} + {`${pluralize(options.get(kind) || kind)}`} ))} diff --git a/plugins/catalog/src/components/CatalogKindHeader/kindFilterUtils.ts b/plugins/catalog/src/components/CatalogKindHeader/kindFilterUtils.ts index 7ac08ae0c8..9fbe82548e 100644 --- a/plugins/catalog/src/components/CatalogKindHeader/kindFilterUtils.ts +++ b/plugins/catalog/src/components/CatalogKindHeader/kindFilterUtils.ts @@ -19,12 +19,12 @@ import { catalogApiRef } from '@backstage/plugin-catalog-react'; import useAsync from 'react-use/esm/useAsync'; /** - * Fetch and return all availible kinds. + * Fetch and return all available kinds. */ export function useAllKinds(): { loading: boolean; error?: Error; - allKinds: string[]; + allKinds: Map; } { const catalogApi = useApi(catalogApiRef); @@ -33,50 +33,40 @@ export function useAllKinds(): { loading, value: allKinds, } = useAsync(async () => { - const items = await catalogApi - .getEntityFacets({ facets: ['kind'] }) - .then(response => response.facets.kind?.map(f => f.value).sort() || []); - return items; + const { facets } = await catalogApi.getEntityFacets({ facets: ['kind'] }); + const kindFacets = (facets.kind ?? []).map(f => f.value); + return new Map( + kindFacets.map(kind => [kind.toLocaleLowerCase('en-US'), kind]), + ); }, [catalogApi]); - return { loading, error, allKinds: allKinds ?? [] }; + return { loading, error, allKinds: allKinds ?? new Map() }; } /** * Filter and capitalize accessible kinds. */ export function filterKinds( - allKinds: string[], + allKinds: Map, allowedKinds?: string[], forcedKinds?: string, -): Record { +): Map { // Before allKinds is loaded, or when a kind is entered manually in the URL, selectedKind may not // be present in allKinds. It should still be shown in the dropdown, but may not have the nice // enforced casing from the catalog-backend. This makes a key/value record for the Select options, // including selectedKind if it's unknown - but allows the selectedKind to get clobbered by the // more proper catalog kind if it exists. - let availableKinds = allKinds; - if (allowedKinds) { - availableKinds = availableKinds.filter(k => - allowedKinds.some( - a => a.toLocaleLowerCase('en-US') === k.toLocaleLowerCase('en-US'), - ), - ); - } - if ( - forcedKinds && - !allKinds.some( - a => - a.toLocaleLowerCase('en-US') === forcedKinds.toLocaleLowerCase('en-US'), - ) - ) { - availableKinds = availableKinds.concat([forcedKinds]); - } + const desiredKinds = allowedKinds + ? allowedKinds.map(k => k.toLocaleLowerCase('en-US')) + : Array.from(allKinds.keys()); - const kindsMap = availableKinds.sort().reduce((acc, kind) => { - acc[kind.toLocaleLowerCase('en-US')] = kind; - return acc; - }, {} as Record); + const kindsMap = new Map( + desiredKinds.map(kind => [kind, allKinds.get(kind) || kind]), + ); + + if (forcedKinds && !kindsMap.has(forcedKinds)) { + kindsMap.set(forcedKinds.toLocaleLowerCase('en-US'), forcedKinds); + } return kindsMap; } diff --git a/plugins/catalog/src/components/CatalogTable/CatalogTable.test.tsx b/plugins/catalog/src/components/CatalogTable/CatalogTable.test.tsx index 13ee7593b9..71ddd50b05 100644 --- a/plugins/catalog/src/components/CatalogTable/CatalogTable.test.tsx +++ b/plugins/catalog/src/components/CatalogTable/CatalogTable.test.tsx @@ -111,6 +111,7 @@ describe('CatalogTable component', () => { ), kind: { value: 'component', + label: 'Component', getCatalogFilters: () => ({ kind: 'component' }), toQueryValue: () => 'component', }, @@ -126,7 +127,7 @@ describe('CatalogTable component', () => { }, }, ); - expect(screen.getByText(/Owned components \(3\)/)).toBeInTheDocument(); + expect(screen.getByText(/Owned Components \(3\)/)).toBeInTheDocument(); expect(screen.getByText(/component1/)).toBeInTheDocument(); expect(screen.getByText(/component2/)).toBeInTheDocument(); expect(screen.getByText(/component3/)).toBeInTheDocument(); @@ -300,7 +301,9 @@ describe('CatalogTable component', () => { value={{ entities, filters: { - kind: kind ? new EntityKindFilter(kind) : undefined, + kind: kind + ? new EntityKindFilter(kind.toLocaleLowerCase('en-US'), kind) + : undefined, }, }} > @@ -420,6 +423,7 @@ describe('CatalogTable component', () => { filters: { kind: { value: 'api', + label: 'API', getCatalogFilters: () => ({ kind: 'api' }), toQueryValue: () => 'api', }, diff --git a/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx b/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx index 944e795709..c565cffa93 100644 --- a/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx +++ b/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx @@ -183,7 +183,7 @@ export const CatalogTable = (props: CatalogTableProps) => { }, ]; - const currentKind = filters.kind?.value || ''; + const currentKind = filters.kind?.label || ''; const currentType = filters.type?.value || ''; const currentCount = typeof totalItems === 'number' ? `(${totalItems})` : ''; // TODO(timbonicus): remove the title from the CatalogTable once using EntitySearchBar diff --git a/plugins/catalog/src/components/CatalogTable/CursorPaginatedCatalogTable.test.tsx b/plugins/catalog/src/components/CatalogTable/CursorPaginatedCatalogTable.test.tsx index b0deec9679..169c1277b9 100644 --- a/plugins/catalog/src/components/CatalogTable/CursorPaginatedCatalogTable.test.tsx +++ b/plugins/catalog/src/components/CatalogTable/CursorPaginatedCatalogTable.test.tsx @@ -162,7 +162,7 @@ describe('CursorPaginatedCatalogTable', () => { entities: data.map(e => e.entity), totalItems: data.length, filters: { - kind: new EntityKindFilter('component'), + kind: new EntityKindFilter('component', 'Component'), }, }} > diff --git a/plugins/scaffolder/src/components/TemplateTypePicker/TemplateTypePicker.test.tsx b/plugins/scaffolder/src/components/TemplateTypePicker/TemplateTypePicker.test.tsx index e7b12f42c0..1fe7ffb17e 100644 --- a/plugins/scaffolder/src/components/TemplateTypePicker/TemplateTypePicker.test.tsx +++ b/plugins/scaffolder/src/components/TemplateTypePicker/TemplateTypePicker.test.tsx @@ -90,7 +90,7 @@ describe('', () => { @@ -113,7 +113,7 @@ describe('', () => { diff --git a/plugins/techdocs/src/home/components/Tables/CursorPaginatedDocsTable.test.tsx b/plugins/techdocs/src/home/components/Tables/CursorPaginatedDocsTable.test.tsx index d7ab3827e1..69bcc5d46b 100644 --- a/plugins/techdocs/src/home/components/Tables/CursorPaginatedDocsTable.test.tsx +++ b/plugins/techdocs/src/home/components/Tables/CursorPaginatedDocsTable.test.tsx @@ -145,7 +145,7 @@ describe('CursorPaginatedDocsTable', () => { entities: data.map(e => e.entity), totalItems: data.length, filters: { - kind: new EntityKindFilter('techdocs'), + kind: new EntityKindFilter('techdocs', 'TechDocs'), }, }} >