codeant-ai-for-open-source[bot] commented on code in PR #41392: URL: https://github.com/apache/superset/pull/41392#discussion_r3534752571
########## superset-frontend/plugins/plugin-chart-ag-grid-table/test/cellSelectionWiring.test.tsx: ########## @@ -0,0 +1,99 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import { render, waitFor } from '@superset-ui/core/spec'; +import { ProviderWrapper } from '../../plugin-chart-table/test/testHelpers'; +import testData from '../../plugin-chart-table/test/testData'; + +// Capture the props the grid is rendered with, so we can assert the +// cell-selection wiring without depending on AG Grid's DOM rendering. +const captured: { props?: Record<string, any> } = {}; Review Comment: **Suggestion:** Replace the `any` in the captured props record with a concrete props/value type so the test maintains strict typing. [custom_rule] **Severity Level:** Minor ⚠️ <details> <summary><b>Why it matters? 🤔 </b></summary> The file introduces a TypeScript `any` in `Record<string, any>`, which directly violates the no-any-types rule for new or changed TypeScript code. </details> <details> <summary><b>Rule source 📖 </b></summary> .cursor/rules/dev-standard.mdc (line 16) </details> [](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=1c2bd553e0484ff9a7733dc837607bb0&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=1c2bd553e0484ff9a7733dc837607bb0&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) *(Use Cmd/Ctrl + Click for best experience)* <details> <summary><b>Prompt for AI Agent 🤖 </b></summary> ```mdx This is a comment left during a code review. **Path:** superset-frontend/plugins/plugin-chart-ag-grid-table/test/cellSelectionWiring.test.tsx **Line:** 25:25 **Comment:** *Custom Rule: Replace the `any` in the captured props record with a concrete props/value type so the test maintains strict typing. Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise. Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix ``` </details> <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41392&comment_hash=95beed5c25e947baa5a544cdc272f9c8a0b58ed0ea94d68cf99fc405349e6517&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41392&comment_hash=95beed5c25e947baa5a544cdc272f9c8a0b58ed0ea94d68cf99fc405349e6517&reaction=dislike'>👎</a> ########## superset-frontend/plugins/plugin-chart-ag-grid-table/test/cellSelectionWiring.test.tsx: ########## @@ -0,0 +1,99 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import { render, waitFor } from '@superset-ui/core/spec'; +import { ProviderWrapper } from '../../plugin-chart-table/test/testHelpers'; +import testData from '../../plugin-chart-table/test/testData'; + +// Capture the props the grid is rendered with, so we can assert the +// cell-selection wiring without depending on AG Grid's DOM rendering. +const captured: { props?: Record<string, any> } = {}; + +// Mock the narrow ThemedAgGridReact module (which the components barrel +// re-exports) rather than the whole barrel, to avoid its circular-init. +jest.mock('@superset-ui/core/components/ThemedAgGridReact', () => ({ + __esModule: true, + ThemedAgGridReact: (props: Record<string, any>) => { Review Comment: **Suggestion:** Change the mocked component parameter type from `any` to a specific AG Grid props interface (or a narrowed custom type) to satisfy strict typing requirements. [custom_rule] **Severity Level:** Minor ⚠️ <details> <summary><b>Why it matters? 🤔 </b></summary> The mocked component parameter is typed with `Record<string, any>`, which includes `any` and therefore violates the no-any-types rule. </details> <details> <summary><b>Rule source 📖 </b></summary> .cursor/rules/dev-standard.mdc (line 16) </details> [](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=0df9fbb5c5a6442db87840621a8e5a0a&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=0df9fbb5c5a6442db87840621a8e5a0a&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) *(Use Cmd/Ctrl + Click for best experience)* <details> <summary><b>Prompt for AI Agent 🤖 </b></summary> ```mdx This is a comment left during a code review. **Path:** superset-frontend/plugins/plugin-chart-ag-grid-table/test/cellSelectionWiring.test.tsx **Line:** 31:31 **Comment:** *Custom Rule: Change the mocked component parameter type from `any` to a specific AG Grid props interface (or a narrowed custom type) to satisfy strict typing requirements. Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise. Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix ``` </details> <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41392&comment_hash=3a1855581e7d5d88e03ce57df12bdbe4833add989e96beeb5e57be5b86fe8066&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41392&comment_hash=3a1855581e7d5d88e03ce57df12bdbe4833add989e96beeb5e57be5b86fe8066&reaction=dislike'>👎</a> -- 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]
