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


##########
superset-frontend/src/pages/ActionLog/index.test.tsx:
##########
@@ -0,0 +1,68 @@
+import React from 'react';
+import '@testing-library/jest-dom';
+import { render, screen } from '@testing-library/react';
+import ActionLogList from './index';
+
+
+jest.mock('src/views/CRUD/hooks', () => ({
+  useListViewResource: () => ({
+    state: {
+      loading: false,
+      resourceCount: 1,
+      resourceCollection: [
+        {
+          action: 'test',
+          user: {
+            username: 'guid-123',
+            first_name: 'John',
+            last_name: 'Doe',
+          },
+        },
+      ],
+      bulkSelectEnabled: false,
+    },
+    fetchData: jest.fn(),
+    refreshData: jest.fn(),
+    toggleBulkSelect: jest.fn(),
+  }),
+}));
+
+jest.mock('src/components/MessageToasts/withToasts', () => ({
+  __esModule: true,
+  default: (Component: any) => Component,
+  useToasts: () => ({
+    addDangerToast: jest.fn(),
+    addSuccessToast: jest.fn(),
+  }),
+}));
+
+jest.mock('src/features/home/SubMenu', () => ({
+  __esModule: true,
+  default: () => <div />,
+}));
+
+jest.mock('src/components/ListView', () => ({
+  __esModule: true,
+  ListView: ({ data }: any) => (
+    <div>
+      {data.map((row: any) => (
+        <div key={row.user.username}>
+          {row.user.first_name} {row.user.last_name}
+        </div>
+      ))}
+    </div>
+  ),
+  ListViewFilterOperator: {
+    RelationOneMany: 'RelationOneMany',
+    Equals: 'Equals',
+    Contains: 'Contains',
+    Between: 'Between',
+  },
+}));
+
+describe('ActionLog User column display', () => {
+  it('renders full name when first_name and last_name exist', () => {
+    render(<ActionLogList />);
+    expect(screen.getByText('John Doe')).toBeInTheDocument();
+  });
+});

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Incomplete Test Logic</b></div>
   <div id="fix">
   
   The test mocks ListView to bypass the actual column rendering, preventing 
verification of the user display logic in the Cell component. It only checks 
rendering without validating the business logic for how user names are computed 
and displayed.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #823366</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