mirror of
https://github.com/apache/superset.git
synced 2026-05-12 19:35:17 +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!',
|
some_param: 'fake query!',
|
||||||
result_type: 'full',
|
result_type: 'full',
|
||||||
result_format: 'json',
|
result_format: 'json',
|
||||||
});
|
} as unknown as ReturnType<typeof exploreUtils.buildV1ChartDataPayload>);
|
||||||
fakeMetadata = { useLegacyApi: true };
|
fakeMetadata = { useLegacyApi: true };
|
||||||
mockedGetChartMetadataRegistry.mockImplementation(
|
mockedGetChartMetadataRegistry.mockImplementation(
|
||||||
() =>
|
() =>
|
||||||
({
|
({
|
||||||
get: () => fakeMetadata,
|
get: () => fakeMetadata,
|
||||||
}) as ReturnType<typeof getChartMetadataRegistry>,
|
}) as unknown as ReturnType<typeof getChartMetadataRegistry>,
|
||||||
);
|
);
|
||||||
mockedGetChartBuildQueryRegistry.mockImplementation(
|
mockedGetChartBuildQueryRegistry.mockImplementation(
|
||||||
() =>
|
() =>
|
||||||
@@ -145,7 +145,7 @@ describe('chart actions', () => {
|
|||||||
result_type: 'full',
|
result_type: 'full',
|
||||||
result_format: 'json',
|
result_format: 'json',
|
||||||
}),
|
}),
|
||||||
}) as ReturnType<typeof getChartBuildQueryRegistry>,
|
}) as unknown as ReturnType<typeof getChartBuildQueryRegistry>,
|
||||||
);
|
);
|
||||||
waitForAsyncDataStub = sinon
|
waitForAsyncDataStub = sinon
|
||||||
.stub(asyncEvent, 'waitForAsyncData')
|
.stub(asyncEvent, 'waitForAsyncData')
|
||||||
|
|||||||
Reference in New Issue
Block a user