michael-s-molina commented on a change in pull request #17069:
URL: https://github.com/apache/superset/pull/17069#discussion_r734442791



##########
File path: superset-frontend/src/components/Datasource/DatasourceEditor.test.jsx
##########
@@ -84,135 +80,123 @@ describe('DatasourceEditor', () => {
       }, 0);
     }));
 
-  it('to add, remove and modify columns accordingly', () => {
-    const columns = [
-      {
-        name: 'ds',
-        type: 'DATETIME',
-        nullable: true,
-        default: '',
-        primary_key: false,
-        is_dttm: true,
-      },
-      {
-        name: 'gender',
-        type: 'VARCHAR(32)',
-        nullable: true,
-        default: '',
-        primary_key: false,
-        is_dttm: false,
-      },
-      {
-        name: 'new_column',
-        type: 'VARCHAR(10)',
-        nullable: true,
-        default: '',
-        primary_key: false,
-        is_dttm: false,
-      },
-    ];
-
-    const numCols = props.datasource.columns.length;
-    expect(inst.state.databaseColumns).toHaveLength(numCols);
-    inst.updateColumns(columns);
-    expect(inst.state.databaseColumns).toEqual(
-      expect.arrayContaining([
-        {
-          type: 'DATETIME',
-          description: null,
-          filterable: false,
-          verbose_name: null,
-          is_dttm: true,
-          expression: '',
-          groupby: false,
-          column_name: 'ds',
-        },
-        {
-          type: 'VARCHAR(32)',
-          description: null,
-          filterable: true,
-          verbose_name: null,
-          is_dttm: false,
-          expression: '',
-          groupby: true,
-          column_name: 'gender',
-        },
-        expect.objectContaining({
-          column_name: 'new_column',
-          type: 'VARCHAR(10)',
-        }),
-      ]),
-    );
-    expect(inst.state.databaseColumns).not.toEqual(
-      expect.arrayContaining([expect.objectContaining({ name: 'name' })]),
+  it('to add, remove and modify columns accordingly', async () => {

Review comment:
       Maybe split into 3 separate test cases? Imagine a scenario where the 
addition of columns is working but the removal of columns is not. Splitting 
into 3 test cases will give us more accurate test results.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to