From b0b45cca0425ddb4ca52f9b8b4e62ae1284e39a2 Mon Sep 17 00:00:00 2001 From: Evan Rusackas Date: Wed, 14 Jan 2026 17:11:25 -0800 Subject: [PATCH] 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 --- superset-frontend/src/components/Chart/chartActions.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/superset-frontend/src/components/Chart/chartActions.test.ts b/superset-frontend/src/components/Chart/chartActions.test.ts index cdce6da30a3..03c841a5d6b 100644 --- a/superset-frontend/src/components/Chart/chartActions.test.ts +++ b/superset-frontend/src/components/Chart/chartActions.test.ts @@ -129,13 +129,13 @@ describe('chart actions', () => { some_param: 'fake query!', result_type: 'full', result_format: 'json', - }); + } as unknown as ReturnType); fakeMetadata = { useLegacyApi: true }; mockedGetChartMetadataRegistry.mockImplementation( () => ({ get: () => fakeMetadata, - }) as ReturnType, + }) as unknown as ReturnType, ); mockedGetChartBuildQueryRegistry.mockImplementation( () => @@ -145,7 +145,7 @@ describe('chart actions', () => { result_type: 'full', result_format: 'json', }), - }) as ReturnType, + }) as unknown as ReturnType, ); waitForAsyncDataStub = sinon .stub(asyncEvent, 'waitForAsyncData')