From f6c304437a507cac2d0307714a1fcf41b0f05897 Mon Sep 17 00:00:00 2001
From: Lyndsi Kay Williams <55605634+lyndsiWilliams@users.noreply.github.com>
Date: Wed, 15 Feb 2023 14:10:23 -0600
Subject: [PATCH] test: Clean up SelectAsyncControl test warnings (#22969)
---
.../SelectAsyncControl.test.tsx | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/superset-frontend/src/explore/components/controls/SelectAsyncControl/SelectAsyncControl.test.tsx b/superset-frontend/src/explore/components/controls/SelectAsyncControl/SelectAsyncControl.test.tsx
index bc78434850..80bdc78bab 100644
--- a/superset-frontend/src/explore/components/controls/SelectAsyncControl/SelectAsyncControl.test.tsx
+++ b/superset-frontend/src/explore/components/controls/SelectAsyncControl/SelectAsyncControl.test.tsx
@@ -65,17 +65,17 @@ beforeEach(() => {
jest.resetAllMocks();
});
-test('Should render', () => {
+test('Should render', async () => {
const props = createProps();
render(, { useRedux: true });
- expect(screen.getByTestId('select-test')).toBeInTheDocument();
+ expect(await screen.findByTestId('select-test')).toBeInTheDocument();
});
-test('Should send correct props to Select component - value props', () => {
+test('Should send correct props to Select component - value props', async () => {
const props = createProps();
render(, { useRedux: true });
- expect(screen.getByTestId('select-test')).toHaveAttribute(
+ expect(await screen.findByTestId('select-test')).toHaveAttribute(
'data-value',
JSON.stringify(props.value),
);
@@ -89,20 +89,20 @@ test('Should send correct props to Select component - value props', () => {
);
});
-test('Should send correct props to Select component - function onChange multi:true', () => {
+test('Should send correct props to Select component - function onChange multi:true', async () => {
const props = createProps();
render(, { useRedux: true });
expect(props.onChange).toBeCalledTimes(0);
- userEvent.click(screen.getByText('onChange'));
+ userEvent.click(await screen.findByText('onChange'));
expect(props.onChange).toBeCalledTimes(1);
});
-test('Should send correct props to Select component - function onChange multi:false', () => {
+test('Should send correct props to Select component - function onChange multi:false', async () => {
const props = createProps();
render(, {
useRedux: true,
});
expect(props.onChange).toBeCalledTimes(0);
- userEvent.click(screen.getByText('onChange'));
+ userEvent.click(await screen.findByText('onChange'));
expect(props.onChange).toBeCalledTimes(1);
});