[Observability] adjust FieldValueSuggestions test to prevent flakiness (#106420)
This commit is contained in:
parent
0a5c96b117
commit
a9d645410e
|
@ -7,14 +7,13 @@
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { FieldValueSuggestions } from './index';
|
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 * as searchHook from '../../../hooks/use_es_search';
|
||||||
import { EuiThemeProvider } from '../../../../../../../src/plugins/kibana_react/common';
|
import { EuiThemeProvider } from '../../../../../../../src/plugins/kibana_react/common';
|
||||||
|
|
||||||
jest.setTimeout(30000);
|
jest.setTimeout(30000);
|
||||||
|
|
||||||
// flaky https://github.com/elastic/kibana/issues/105784
|
describe('FieldValueSuggestions', () => {
|
||||||
describe.skip('FieldValueSuggestions', () => {
|
|
||||||
jest.spyOn(HTMLElement.prototype, 'offsetHeight', 'get').mockReturnValue(1500);
|
jest.spyOn(HTMLElement.prototype, 'offsetHeight', 'get').mockReturnValue(1500);
|
||||||
jest.spyOn(HTMLElement.prototype, 'offsetWidth', 'get').mockReturnValue(1500);
|
jest.spyOn(HTMLElement.prototype, 'offsetWidth', 'get').mockReturnValue(1500);
|
||||||
|
|
||||||
|
@ -109,6 +108,8 @@ describe.skip('FieldValueSuggestions', () => {
|
||||||
expect(onChange).toHaveBeenCalledTimes(1);
|
expect(onChange).toHaveBeenCalledTimes(1);
|
||||||
expect(onChange).toHaveBeenCalledWith(['US'], []);
|
expect(onChange).toHaveBeenCalledWith(['US'], []);
|
||||||
|
|
||||||
|
await waitForElementToBeRemoved(() => screen.queryByText('Apply'));
|
||||||
|
|
||||||
rerender(
|
rerender(
|
||||||
<EuiThemeProvider darkMode={false}>
|
<EuiThemeProvider darkMode={false}>
|
||||||
<FieldValueSuggestions
|
<FieldValueSuggestions
|
||||||
|
|
Loading…
Reference in a new issue