[7.x] [Observability] adjust FieldValueSuggestions test to prevent flakiness (#106420) (#106605)

* [Observability] adjust FieldValueSuggestions test to prevent flakiness (#106420)

* Click to open flyout

* Adjust formatting

Co-authored-by: Dominique Clarke <doclarke71@gmail.com>
Co-authored-by: Dominique Clarke <dominique.clarke@elastic.co>
This commit is contained in:
Kibana Machine 2021-07-26 17:39:37 -04:00 committed by GitHub
parent 92aadfa55d
commit 1775b06848
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,14 +7,13 @@
import React from 'react';
import { FieldValueSuggestions } from './index';
import { render, screen, fireEvent } from '@testing-library/react';
import { render, screen, fireEvent, waitForElementToBeRemoved } from '@testing-library/react';
import * as searchHook from '../../../hooks/use_es_search';
import { EuiThemeProvider } from '../../../../../../../src/plugins/kibana_react/common';
jest.setTimeout(30000);
// flaky https://github.com/elastic/kibana/issues/105784
describe.skip('FieldValueSuggestions', () => {
describe('FieldValueSuggestions', () => {
jest.spyOn(HTMLElement.prototype, 'offsetHeight', 'get').mockReturnValue(1500);
jest.spyOn(HTMLElement.prototype, 'offsetWidth', 'get').mockReturnValue(1500);
@ -109,6 +108,8 @@ describe.skip('FieldValueSuggestions', () => {
expect(onChange).toHaveBeenCalledTimes(1);
expect(onChange).toHaveBeenCalledWith(['US'], []);
await waitForElementToBeRemoved(() => screen.queryByText('Apply'));
rerender(
<EuiThemeProvider darkMode={false}>
<FieldValueSuggestions