Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
Tostti committed Dec 12, 2024
1 parent ee6729a commit 0b3c3d4
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions plugins/main/public/components/common/tables/table-wz-api.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
import React from 'react';
import { mount } from 'enzyme';
import { TableWzAPI } from './table-wz-api';
import { useAppConfig, useStateStorage } from '../hooks';

jest.mock('../hooks', () => ({
useAppConfig: jest.fn(),
useStateStorage: jest.fn(),
}));

jest.mock('../../../kibana-services', () => ({
getHttp: () => ({
Expand Down Expand Up @@ -64,6 +70,13 @@ const columns = [

describe('Table WZ API component', () => {
it('renders correctly to match the snapshot', () => {
(useAppConfig as jest.Mock).mockReturnValue({
data: {
'reports.csv.maxRows': 10000,
},
});
(useStateStorage as jest.Mock).mockReturnValue([[], jest.fn()]);

const wrapper = mount(
<TableWzAPI
title='Table'
Expand Down

0 comments on commit 0b3c3d4

Please sign in to comment.