Skip to content

Commit

Permalink
Use findBy
Browse files Browse the repository at this point in the history
  • Loading branch information
geido committed Mar 9, 2021
1 parent 28f5b07 commit 28bd925
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import React from 'react';
import { render, screen, waitFor } from 'spec/helpers/testing-library';
import { render, screen } from 'spec/helpers/testing-library';
import userEvent from '@testing-library/user-event';
import fetchMock from 'fetch-mock';
import SupersetResourceSelect from '.';
Expand Down Expand Up @@ -52,15 +52,13 @@ test('should render the No options message', async () => {
render(<SupersetResourceSelect {...mockedProps} />);
const select = screen.getByText('Select...');
userEvent.click(select);
await waitFor(() => {
expect(screen.getByText('No options')).toBeInTheDocument();
});
expect(await screen.findByText('No options')).toBeInTheDocument();
});

test('should render the typed text', async () => {
render(<SupersetResourceSelect {...mockedProps} />);
const select = screen.getByText('Select...');
userEvent.click(select);
userEvent.type(select, 'typed text');
expect(screen.getByText('typed text')).toBeInTheDocument();
expect(await screen.findByText('typed text')).toBeInTheDocument();
});

0 comments on commit 28bd925

Please sign in to comment.