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:
Evan Rusackas
2026-01-14 17:11:25 -08:00
parent 5048433eab
commit b0b45cca04

View File

@@ -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')