Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cnasikas committed Jun 12, 2024
1 parent 896f3fa commit 21909ec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import ServiceNowITSMParamsFields from './servicenow_itsm_params';
import { Choice } from '../lib/servicenow/types';
import { ACTION_GROUP_RECOVERED } from '../lib/servicenow/helpers';
import userEvent from '@testing-library/user-event';
import { I18nProvider } from '@kbn/i18n-react';

jest.mock('../lib/servicenow/use_get_choices');
jest.mock('@kbn/triggers-actions-ui-plugin/public/common/lib/kibana');
Expand Down Expand Up @@ -371,7 +372,9 @@ describe('ServiceNowITSMParamsFields renders', () => {

it('updates additional fields', async () => {
const newValue = JSON.stringify({ bar: 'test' });
render(<ServiceNowITSMParamsFields {...defaultProps} />);
render(<ServiceNowITSMParamsFields {...defaultProps} />, {
wrapper: ({ children }) => <I18nProvider>{children}</I18nProvider>,
});

userEvent.paste(await screen.findByTestId('additional_fieldsJsonEditor'), newValue);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import ServiceNowSIRParamsFields from './servicenow_sir_params';
import { Choice } from '../lib/servicenow/types';
import { merge } from 'lodash';
import userEvent from '@testing-library/user-event';
import { I18nProvider } from '@kbn/i18n-react';

jest.mock('../lib/servicenow/use_get_choices');
jest.mock('@kbn/triggers-actions-ui-plugin/public/common/lib/kibana');
Expand Down Expand Up @@ -346,7 +347,9 @@ describe('ServiceNowSIRParamsFields renders', () => {

it('updates additional fields', async () => {
const newValue = JSON.stringify({ bar: 'test' });
render(<ServiceNowSIRParamsFields {...defaultProps} />);
render(<ServiceNowSIRParamsFields {...defaultProps} />, {
wrapper: ({ children }) => <I18nProvider>{children}</I18nProvider>,
});

userEvent.paste(await screen.findByTestId('additional_fieldsJsonEditor'), newValue);

Expand Down

0 comments on commit 21909ec

Please sign in to comment.