mirror of
https://github.com/apache/superset.git
synced 2026-05-07 08:54:23 +00:00
fix(tests): add type casting for mock return types in chartActions tests
Add `as unknown as` casting to mock implementations to satisfy TypeScript's strict type checking while preserving the original test behavior. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -129,13 +129,13 @@ describe('chart actions', () => {
|
||||
some_param: 'fake query!',
|
||||
result_type: 'full',
|
||||
result_format: 'json',
|
||||
});
|
||||
} as unknown as ReturnType<typeof exploreUtils.buildV1ChartDataPayload>);
|
||||
fakeMetadata = { useLegacyApi: true };
|
||||
mockedGetChartMetadataRegistry.mockImplementation(
|
||||
() =>
|
||||
({
|
||||
get: () => fakeMetadata,
|
||||
}) as ReturnType<typeof getChartMetadataRegistry>,
|
||||
}) as unknown as ReturnType<typeof getChartMetadataRegistry>,
|
||||
);
|
||||
mockedGetChartBuildQueryRegistry.mockImplementation(
|
||||
() =>
|
||||
@@ -145,7 +145,7 @@ describe('chart actions', () => {
|
||||
result_type: 'full',
|
||||
result_format: 'json',
|
||||
}),
|
||||
}) as ReturnType<typeof getChartBuildQueryRegistry>,
|
||||
}) as unknown as ReturnType<typeof getChartBuildQueryRegistry>,
|
||||
);
|
||||
waitForAsyncDataStub = sinon
|
||||
.stub(asyncEvent, 'waitForAsyncData')
|
||||
|
||||
Reference in New Issue
Block a user