diff --git a/packages/grafana-ui/src/components/Select/SelectBase.test.tsx b/packages/grafana-ui/src/components/Select/SelectBase.test.tsx index 4b4eb14b8bb..a17c1e6e326 100644 --- a/packages/grafana-ui/src/components/Select/SelectBase.test.tsx +++ b/packages/grafana-ui/src/components/Select/SelectBase.test.tsx @@ -1,13 +1,16 @@ -import { render, screen, fireEvent } from '@testing-library/react'; +import { render, screen, fireEvent, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import React, { useState } from 'react'; +import { select } from 'react-select-event'; import { SelectableValue } from '@grafana/data'; -import { selectOptionInTest } from '../../../../../public/test/helpers/selectOptionInTest'; - import { SelectBase } from './SelectBase'; +// Used to select an option or options from a Select in unit tests +const selectOptionInTest = async (input: HTMLElement, optionOrOptions: string | RegExp | Array) => + await waitFor(() => select(input, optionOrOptions, { container: document.body })); + describe('SelectBase', () => { const onChangeHandler = jest.fn(); const options: Array> = [ diff --git a/packages/grafana-ui/src/components/uPlot/utils.test.ts b/packages/grafana-ui/src/components/uPlot/utils.test.ts index fc6224ac596..3ecbc180bd9 100644 --- a/packages/grafana-ui/src/components/uPlot/utils.test.ts +++ b/packages/grafana-ui/src/components/uPlot/utils.test.ts @@ -1,7 +1,7 @@ import { FieldMatcherID, fieldMatchers, FieldType, MutableDataFrame } from '@grafana/data'; import { BarAlignment, GraphDrawStyle, GraphTransform, LineInterpolation, StackingMode } from '@grafana/schema'; -import { preparePlotFrame } from '../../../../../public/app/core/components/GraphNG/utils'; +import { preparePlotFrame } from '..'; import { getStackingGroups, preparePlotData2, timeFormatToTemplate } from './utils';