sadpandajoe commented on code in PR #38349:
URL: https://github.com/apache/superset/pull/38349#discussion_r2885206814
##########
superset-frontend/src/dashboard/components/gridComponents/Chart/Chart.test.tsx:
##########
@@ -29,6 +29,15 @@ import chartQueries, {
} from 'spec/fixtures/mockChartQueries';
import Chart from './Chart';
+let capturedChartContainerProps: Record<string, unknown> = {};
+jest.mock('src/components/Chart/ChartContainer', () => {
+ const MockChartContainer = (props: Record<string, unknown>) => {
+ capturedChartContainerProps = props;
+ return <div data-test="chart-container" />;
+ };
+ return { __esModule: true, default: MockChartContainer };
+});
+
Review Comment:
The mock replaces the entire ChartContainer→Chart chain with a simple
`<div>`, which means existing tests now pass against a mock rather than the
real component.
This works today because existing assertions only check
`getByTestId('chart-container')`, but it reduces integration coverage silently.
Doesn't necessarily need to be addressed here, but just calling it out.
--
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]