diff --git a/plugins/explore-react/src/tools/api.ts b/plugins/explore-react/src/tools/api.ts index 34096e8cde..5d96033546 100644 --- a/plugins/explore-react/src/tools/api.ts +++ b/plugins/explore-react/src/tools/api.ts @@ -23,7 +23,7 @@ export const exploreToolsConfigRef = createApiRef({ export type ExploreTool = { title: string; - description: string; + description?: string; url: string; image: string; tags?: string[]; diff --git a/plugins/explore/src/components/ToolCard/ToolCard.test.js b/plugins/explore/src/components/ToolCard/ToolCard.test.tsx similarity index 86% rename from plugins/explore/src/components/ToolCard/ToolCard.test.js rename to plugins/explore/src/components/ToolCard/ToolCard.test.tsx index 83e1e7f186..b3c1737ae6 100644 --- a/plugins/explore/src/components/ToolCard/ToolCard.test.js +++ b/plugins/explore/src/components/ToolCard/ToolCard.test.tsx @@ -44,22 +44,16 @@ describe('', () => { it('should link out', () => { const rendered = render(wrapInTestApp()); const anchor = rendered.container.querySelector('a'); - expect(anchor.href).toBe(minProps.card.url); + expect(anchor).toHaveAttribute('href', minProps.card.url); }); it('renders default description when missing', () => { - const propsWithoutDescription = { - card: { - card: { - title: 'Title', - url: 'http://spotify.com/', - image: 'https://developer.spotify.com/assets/WebAPI_intro.png', - }, - }, + const card = { + title: 'Title', + url: 'http://spotify.com/', + image: 'https://developer.spotify.com/assets/WebAPI_intro.png', }; - const { getByText } = render( - wrapInTestApp(), - ); + const { getByText } = render(wrapInTestApp()); expect(getByText('Description missing')).toBeInTheDocument(); });