diff --git a/packages/grafana-ui/src/components/Gauge/Gauge.test.tsx b/packages/grafana-ui/src/components/Gauge/Gauge.test.tsx index 5c0c80cceec..7dc50f085ba 100644 --- a/packages/grafana-ui/src/components/Gauge/Gauge.test.tsx +++ b/packages/grafana-ui/src/components/Gauge/Gauge.test.tsx @@ -1,14 +1,11 @@ import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; +import $ from 'jquery'; import { ThresholdsMode, FieldConfig, FieldColorModeId, createTheme } from '@grafana/data'; import { Gauge, Props } from './Gauge'; -jest.mock('jquery', () => ({ - plot: jest.fn(), -})); - const field: FieldConfig = { min: 0, max: 100, @@ -38,6 +35,9 @@ const props: Props = { }; describe('Gauge', () => { + // @ts-ignore - mock jquery plot to prevent console.errors + $.plot = jest.fn(); + it('should render without blowing up', () => { expect(() => render()).not.toThrow(); });