bito-code-review[bot] commented on code in PR #43216:
URL: https://github.com/apache/superset/pull/43216#discussion_r3789003436


##########
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: {},
+    });
+  });

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>SEMANTIC_DUPLICATION: Duplicate test case</b></div>
   <div id="fix">
   
   This test is a duplicate of the test starting at line 81. Both create an 
`incomingDb` with `extra: null` and assert `extra_json` defaults to `{}`. The 
second test (with `#43216` reference) is more informative due to its 
accompanying comment explaining the bug scenario. Remove this duplicate to 
avoid maintenance divergence.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #f4d9e5</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



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