mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: adjust more unit tests to work with react 18 (#64759)
adjust unit tests to work with react 18
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { act, render, screen } from '@testing-library/react';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
|
||||
import { DataSourcePluginMeta } from '@grafana/data';
|
||||
@@ -39,9 +39,7 @@ describe('LokiQueryBuilderContainer', () => {
|
||||
render(<LokiQueryBuilderContainer {...props} />);
|
||||
const selector = await screen.findByLabelText('selector');
|
||||
expect(selector.textContent).toBe('{job="testjob"}');
|
||||
await act(async () => {
|
||||
await addOperation('Range functions', 'Rate');
|
||||
});
|
||||
await addOperation('Range functions', 'Rate');
|
||||
expect(await screen.findByText('Rate')).toBeInTheDocument();
|
||||
expect(props.onChange).toBeCalledWith({
|
||||
expr: 'rate({job="testjob"} [$__interval])',
|
||||
|
||||
Reference in New Issue
Block a user