You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ly...@apache.org on 2022/09/09 20:20:36 UTC

[superset] 01/01: 7 act errors removed from DndFilterSelect test

This is an automated email from the ASF dual-hosted git repository.

lyndsi pushed a commit to branch lyndsi/DndFilterSelect-act-cleanup
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 8285357d7bd2bf7b3451da9af7075690ac794771
Author: lyndsiWilliams <kc...@gmail.com>
AuthorDate: Fri Sep 9 15:20:19 2022 -0500

    7 act errors removed from DndFilterSelect test
---
 .../DndFilterSelect.test.tsx                       | 28 ++++++++++++++--------
 1 file changed, 18 insertions(+), 10 deletions(-)

diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndFilterSelect.test.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndFilterSelect.test.tsx
index 7371d7bb48..92a1597dcd 100644
--- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndFilterSelect.test.tsx
+++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndFilterSelect.test.tsx
@@ -48,12 +48,14 @@ const baseFormData = {
   datasource: 'table__1',
 };
 
-test('renders with default props', () => {
+test('renders with default props', async () => {
   render(<DndFilterSelect {...defaultProps} />, { useDnd: true });
-  expect(screen.getByText('Drop columns or metrics here')).toBeInTheDocument();
+  expect(
+    await screen.findByText('Drop columns or metrics here'),
+  ).toBeInTheDocument();
 });
 
-test('renders with value', () => {
+test('renders with value', async () => {
   const value = new AdhocFilter({
     sqlExpression: 'COUNT(*)',
     expressionType: EXPRESSION_TYPES.SQL,
@@ -61,10 +63,10 @@ test('renders with value', () => {
   render(<DndFilterSelect {...defaultProps} value={[value]} />, {
     useDnd: true,
   });
-  expect(screen.getByText('COUNT(*)')).toBeInTheDocument();
+  expect(await screen.findByText('COUNT(*)')).toBeInTheDocument();
 });
 
-test('renders options with saved metric', () => {
+test('renders options with saved metric', async () => {
   render(
     <DndFilterSelect
       {...defaultProps}
@@ -78,10 +80,12 @@ test('renders options with saved metric', () => {
       useDnd: true,
     },
   );
-  expect(screen.getByText('Drop columns or metrics here')).toBeInTheDocument();
+  expect(
+    await screen.findByText('Drop columns or metrics here'),
+  ).toBeInTheDocument();
 });
 
-test('renders options with column', () => {
+test('renders options with column', async () => {
   render(
     <DndFilterSelect
       {...defaultProps}
@@ -98,10 +102,12 @@ test('renders options with column', () => {
       useDnd: true,
     },
   );
-  expect(screen.getByText('Drop columns or metrics here')).toBeInTheDocument();
+  expect(
+    await screen.findByText('Drop columns or metrics here'),
+  ).toBeInTheDocument();
 });
 
-test('renders options with adhoc metric', () => {
+test('renders options with adhoc metric', async () => {
   const adhocMetric = new AdhocMetric({
     expression: 'AVG(birth_names.num)',
     metric_name: 'avg__num',
@@ -119,5 +125,7 @@ test('renders options with adhoc metric', () => {
       useDnd: true,
     },
   );
-  expect(screen.getByText('Drop columns or metrics here')).toBeInTheDocument();
+  expect(
+    await screen.findByText('Drop columns or metrics here'),
+  ).toBeInTheDocument();
 });