hainenber commented on code in PR #37985:
URL: https://github.com/apache/superset/pull/37985#discussion_r2826054037
##########
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>
+ ))}
Review Comment:
@jaymasiwal CodeAnt AI's review is legit here. The current mock-based RTL
test can't verify the rendering logic of actual ActionLogList function.
Given that there's no RTL for this component prior, I'm OK with temporarily
removing this RTL and provide before/after evidences for PR review.
--
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]