rusackas commented on code in PR #43216:
URL: https://github.com/apache/superset/pull/43216#discussion_r3846463087


##########
superset-frontend/src/SqlLab/reducers/sqlLab.test.ts:
##########
@@ -61,6 +61,67 @@ describe('sqlLabReducer', () => {
     });
   });
 
+  test('should default extra_json to an empty object when extra is unset', () 
=> {
+    const incomingDb = {
+      ...databases.result[0],
+      extra: null,
+    };
+    const incomingDbId = Number(incomingDb.id);
+
+    const action = actions.setDatabases([incomingDb] as any);
+
+    const newState = sqlLabReducer(initialState, action);
+
+    expect(newState.databases[incomingDbId]).toEqual({
+      ...incomingDb,
+      extra_json: {},
+    });
+  });
+
+  test('defaults extra_json when a database has no extra (#43216)', () => {

Review Comment:
   @bikash-barnwal let us know if you can tend to that, or would like one of us 
to push a commit and get this through.



-- 
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