codeant-ai-for-open-source[bot] commented on code in PR #42491:
URL: https://github.com/apache/superset/pull/42491#discussion_r3676634684


##########
superset-frontend/src/dashboard/components/gridComponents/Chart/Chart.test.tsx:
##########
@@ -566,3 +566,31 @@ test('should pass filterState from dataMask to 
ChartContainer', () => {
     mockFilterState,
   );
 });
+
+test('should pass chartStackTrace to ChartContainer so dashboard chart errors 
stay expandable', () => {
+  // Regression guard for #31858: the dashboard chart wrapper stopped 
forwarding
+  // the stack trace, so failed charts rendered a flat error with no "See more"
+  // affordance while the same error in Explore stayed expandable.
+  const stackTrace = 'Traceback (most recent call last): ValueError: boom';
+
+  setup(
+    {},
+    {
+      ...defaultState,
+      charts: {
+        ...defaultState.charts,
+        [queryId]: {
+          ...defaultState.charts[queryId],
+          chartStatus: 'failed',
+          chartAlert: 'Something went wrong',
+          chartStackTrace: stackTrace,
+        },
+      },
+    },
+  );
+
+  expect(capturedChartContainerProps).toHaveProperty(
+    'chartStackTrace',
+    stackTrace,
+  );

Review Comment:
   **Suggestion:** The regression test only verifies that the mocked 
`ChartContainer` receives `chartStackTrace`; it never renders the real 
error-message path or asserts that a “See more” control is present. 
Consequently, the test still passes if `ChartContainer` or its downstream error 
renderer ignores the prop and dashboard errors remain non-expandable. Add an 
integration-level assertion using the actual chart error component, or update 
the mock to exercise and verify the expandable UI. [code quality]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ❌ Future dashboard regressions can pass this test undetected.
   - ⚠️ Stack-trace expansion lacks end-to-end dashboard coverage.
   ```
   </details>
   
   [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=e72e1e756b04412799baf0a95853449c&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=e72e1e756b04412799baf0a95853449c&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/src/dashboard/components/gridComponents/Chart/Chart.test.tsx
   **Line:** 570:595
   **Comment:**
        *Code Quality: The regression test only verifies that the mocked 
`ChartContainer` receives `chartStackTrace`; it never renders the real 
error-message path or asserts that a “See more” control is present. 
Consequently, the test still passes if `ChartContainer` or its downstream error 
renderer ignores the prop and dashboard errors remain non-expandable. Add an 
integration-level assertion using the actual chart error component, or update 
the mock to exercise and verify the expandable UI.
   
   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%2F42491&comment_hash=cc2a788d81dda8ce9bdd3f1f5a6346d51839ec4455593795d230973b59ab0c39&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42491&comment_hash=cc2a788d81dda8ce9bdd3f1f5a6346d51839ec4455593795d230973b59ab0c39&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]

Reply via email to