Skip to content

Commit

Permalink
PMM-13176 Add test workaround for react 18 hook
Browse files Browse the repository at this point in the history
  • Loading branch information
YashSartanpara1 committed Jun 26, 2024
1 parent ba38b3e commit d7a842b
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ jest.mock('shared/components/helpers/notification-manager');
jest.mock('./Plan.hooks');

describe('Plan::', () => {
beforeEach(() => {
console.error = jest.fn();
// TODO: Grafana Tooltip component uses a react 18 hook - useId
// due to enzyme we are currently stuck at react 17, mocking for now
// @ts-ignore
React.useId = () => '';
});

it('renders plan query and tooltip', () => {
const { container } = render(<Plan />);

Expand Down

0 comments on commit d7a842b

Please sign in to comment.