Select: Portal select menu to document.body (#36398)

* ValueMappings: Force overflowing modal content to scroll

* ValueMappings: Update unit tests

* Select: Portal Select to document.body, close menu on scroll

* Select: Fix tests + apply updates from https://github.com/grafana/grafana/pull/32833

* ValueMappingsEditorModal: Revert to using selectEvent in the tests

* Select: Fix remaining unit tests

* Portal: Rewrite Portal as a functional component so we can use useTheme2

* Modal: Remove modal styles from this PR

* Update E2E tests

* More unit test fixes

* Select: Fix remaining E2E tests

* Select: Create util method to select an option in tests
This commit is contained in:
Ashley Harrison
2021-07-14 14:04:23 +01:00
committed by GitHub
parent f41f00dec4
commit 54f8996acf
34 changed files with 178 additions and 237 deletions

View File

@@ -1,7 +1,7 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { select } from 'react-select-event';
import { selectOptionInTest } from '@grafana/ui';
import { RawInfluxQLEditor } from './RawInfluxQLEditor';
import { InfluxQuery } from '../types';
@@ -57,7 +57,7 @@ describe('RawInfluxQLEditor', () => {
const formatSelect = screen.getByLabelText('Format as');
expect(formatSelect).toBeInTheDocument();
await select(formatSelect, 'Time series');
await selectOptionInTest(formatSelect, 'Time series');
expect(onChange).toHaveBeenCalledWith({ ...query, resultFormat: 'time_series' });
});