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


##########
superset-frontend/src/explore/components/SaveModal.test.jsx:
##########
@@ -255,6 +255,22 @@ test('disables overwrite option for non-owner', () => {
   expect(getByRole('radio', { name: 'Save (Overwrite)' })).toBeDisabled();
 });
 
+test('enables overwrite option for admin non-owner', () => {
+  const { getByRole } = setup(
+    {},
+    mockStore({
+      ...initialState,
+      user: {
+        userId: 2,
+        username: 'Admin2',
+        roles: { Admin: Array(173) },
+        permissions: {},

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Invalid test mock structure</b></div>
   <div id="fix">
   
   The test mock for user roles uses an incorrect data structure. Roles should 
be a record of role names to arrays of [permission, view] tuples. The current 
Array(173) is invalid and could cause runtime errors if the permissions array 
is accessed elsewhere in the test or code.
   </div>
   
   
   <details>
   <summary>
   <b>Code suggestion</b>
   </summary>
   <blockquote>Check the AI-generated fix before applying</blockquote>
   <div id="code">
   
   
   ````suggestion
         user: {
           userId: 2,
           username: 'Admin2',
           roles: { Admin: [['can_write', 'Chart']] },
           permissions: {},
   ````
   
   </div>
   </details>
   
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #f68473</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