diff --git a/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragOption/DatasourcePanelDragOption.test.tsx b/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragOption/DatasourcePanelDragOption.test.tsx
index be8f91ead..8de766da8 100644
--- a/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragOption/DatasourcePanelDragOption.test.tsx
+++ b/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragOption/DatasourcePanelDragOption.test.tsx
@@ -17,38 +17,35 @@
* under the License.
*/
import React from 'react';
-import { DndProvider } from 'react-dnd';
-import { HTML5Backend } from 'react-dnd-html5-backend';
import { render, screen } from 'spec/helpers/testing-library';
import { DndItemType } from 'src/explore/components/DndItemType';
import DatasourcePanelDragOption from '.';
-test('should render', () => {
+test('should render', async () => {
render(
-
-
- ,
+ ,
+ { useDnd: true },
);
- expect(screen.getByTestId('DatasourcePanelDragOption')).toBeInTheDocument();
+ expect(
+ await screen.findByTestId('DatasourcePanelDragOption'),
+ ).toBeInTheDocument();
expect(screen.getByText('test')).toBeInTheDocument();
});
-test('should have attribute draggable:true', () => {
+test('should have attribute draggable:true', async () => {
render(
-
-
- ,
+ ,
+ { useDnd: true },
);
- expect(screen.getByTestId('DatasourcePanelDragOption')).toHaveAttribute(
- 'draggable',
- 'true',
- );
+ expect(
+ await screen.findByTestId('DatasourcePanelDragOption'),
+ ).toHaveAttribute('draggable', 'true');
});