{ERROR_MESSAGES[errorType].body}
} + /> + ); +}; diff --git a/x-pack/solutions/search/plugins/search_synonyms/public/components/overview/overview.test.tsx b/x-pack/solutions/search/plugins/search_synonyms/public/components/overview/overview.test.tsx new file mode 100644 index 0000000000000..ba7d230c3405b --- /dev/null +++ b/x-pack/solutions/search/plugins/search_synonyms/public/components/overview/overview.test.tsx @@ -0,0 +1,57 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; +import { render, screen } from '@testing-library/react'; +import React from 'react'; +import { SearchSynonymsOverview } from './overview'; +import { I18nProvider } from '@kbn/i18n-react'; +import { useFetchSynonymsSets } from '../../hooks/use_fetch_synonyms_sets'; + +jest.mock('../../hooks/use_fetch_synonyms_sets', () => ({ + useFetchSynonymsSets: jest.fn(() => ({ + data: undefined, + isLoading: false, + isError: true, + error: { body: { statusCode: 500 } }, + })), +})); + +describe('Search Synonyms Overview', () => { + const queryClient = new QueryClient(); + const Wrapper = ({ children }: { children?: React.ReactNode }) => ( +