Chore: clean up console warning from Query Header tests (#46663)

This commit is contained in:
Kevin Yu 2022-03-17 06:57:43 -07:00 committed by GitHub
parent cffa52d906
commit 7c255f190c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,5 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import { act } from 'react-dom/test-utils';
import { render, screen, waitFor, act } from '@testing-library/react';
import { CloudWatchLogsQuery, CloudWatchMetricsQuery, MetricEditorMode, MetricQueryType } from '../types';
import { setupMockedDataSource } from '../__mocks__/CloudWatchDataSource';
import QueryHeader from './QueryHeader';
@ -74,9 +73,9 @@ describe('QueryHeader', () => {
/>
);
const builderElement = screen.queryByLabelText('Builder');
expect(builderElement).toBeNull();
const codeElement = screen.queryByLabelText('Code');
expect(codeElement).toBeNull();
await waitFor(() => {
expect(screen.queryByLabelText('Builder')).toBeNull();
expect(screen.queryByLabelText('Code')).toBeNull();
});
});
});