Skip to content

Commit

Permalink
[Observability] adjust FieldValueSuggestions test to prevent flakiness (
Browse files Browse the repository at this point in the history
  • Loading branch information
dominiqueclarke authored Jul 22, 2021
1 parent 0a5c96b commit a9d6454
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a9d6454

Please sign in to comment.