Skip to content

Commit

Permalink
fixing test
Browse files Browse the repository at this point in the history
  • Loading branch information
jgowdyelastic committed Jan 26, 2024
1 parent c45c849 commit a60f24d
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import type { Category } from '../../../common/api/log_categorization/types';
import { useCreateFormattedExample } from './format_category';
import { renderHook } from '@testing-library/react-hooks';

jest.mock('../../hooks/use_eui_theme', () => ({
useIsDarkTheme: () => false,
Expand Down Expand Up @@ -87,7 +88,8 @@ const categoryData: Array<{
describe('FormattedPatternExamples', () => {
it('correctly splits each example into correct number of html elements', () => {
categoryData.forEach(({ category, elementCount }) => {
const createFormattedExample = useCreateFormattedExample();
const { result } = renderHook(() => useCreateFormattedExample());
const createFormattedExample = result.current;
const resp = createFormattedExample(category.key, category.examples[0]);
expect(resp.length).toEqual(elementCount);
});
Expand Down

0 comments on commit a60f24d

Please sign in to comment.