diff --git a/packages/core-components/src/components/Link/Link.test.tsx b/packages/core-components/src/components/Link/Link.test.tsx index d65351d840..7be8753b34 100644 --- a/packages/core-components/src/components/Link/Link.test.tsx +++ b/packages/core-components/src/components/Link/Link.test.tsx @@ -21,11 +21,9 @@ import { TestApiProvider, wrapInTestApp, } from '@backstage/test-utils'; -import { analyticsApiRef, configApiRef } from '@backstage/core-plugin-api'; -import { isExternalUri, Link, useResolvedPath } from './Link'; +import { analyticsApiRef } from '@backstage/core-plugin-api'; +import { isExternalUri, Link } from './Link'; import { Route, Routes } from 'react-router'; -import { renderHook, WrapperComponent } from '@testing-library/react-hooks'; -import { ConfigReader } from '@backstage/config'; describe('', () => { it('navigates using react-router', async () => { @@ -132,45 +130,4 @@ describe('', () => { expect(isExternalUri(uri)).toBe(expected); }); }); - - describe('useResolvedPath', () => { - const wrapper: WrapperComponent<{}> = ({ children }) => { - const configApi = new ConfigReader({ - app: { baseUrl: 'http://localhost:3000/example' }, - }); - return ( - - {children} - - ); - }; - - describe('concatenate base path', () => { - it('when uri is internal and does not start with base path', () => { - const path = '/catalog/default/component/artist-lookup'; - const { result } = renderHook(() => useResolvedPath(path), { - wrapper, - }); - expect(result.current).toBe('/example'.concat(path)); - }); - }); - - describe('does not concatenate base path', () => { - it('when uri is external', () => { - const path = 'https://stackoverflow.com/questions/1/example'; - const { result } = renderHook(() => useResolvedPath(path), { - wrapper, - }); - expect(result.current).toBe(path); - }); - - it('when uri already starts with base path', () => { - const path = '/example/catalog/default/component/artist-lookup'; - const { result } = renderHook(() => useResolvedPath(path), { - wrapper, - }); - expect(result.current).toBe(path); - }); - }); - }); }); diff --git a/packages/core-components/src/components/Link/Link.tsx b/packages/core-components/src/components/Link/Link.tsx index 66b7453abd..239f6382c4 100644 --- a/packages/core-components/src/components/Link/Link.tsx +++ b/packages/core-components/src/components/Link/Link.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { configApiRef, useAnalytics, useApi } from '@backstage/core-plugin-api'; +import { useAnalytics } from '@backstage/core-plugin-api'; import classnames from 'classnames'; // eslint-disable-next-line no-restricted-imports import MaterialLink, { diff --git a/packages/core-components/src/components/Table/Table.tsx b/packages/core-components/src/components/Table/Table.tsx index 81471324a0..1d16dc9b83 100644 --- a/packages/core-components/src/components/Table/Table.tsx +++ b/packages/core-components/src/components/Table/Table.tsx @@ -373,7 +373,7 @@ export function Table(props: TableProps) { const newData = (data as any[]).filter( el => !!Object.entries(selectedFilters) - .filter(([, value]) => !!value.length) + .filter(([, value]: [any, any]) => !!value.length) .every(([key, filterValue]) => { const fieldValue = extractValueByField( el,