From 5c38df7d61dca36cf7042e6f2b63a4a8d87a1373 Mon Sep 17 00:00:00 2001 From: Evan Date: Thu, 25 Jun 2026 07:14:22 -0700 Subject: [PATCH] test(sqllab,extensions): replace any casts with concrete types Co-Authored-By: Claude Opus 4.8 --- superset-frontend/src/core/sqlLab/sqlLab.test.ts | 3 ++- .../src/extensions/ExtensionsStartup.test.tsx | 8 ++++---- superset-frontend/src/extensions/ExtensionsStartup.tsx | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/superset-frontend/src/core/sqlLab/sqlLab.test.ts b/superset-frontend/src/core/sqlLab/sqlLab.test.ts index 79bddd6fc4a..1822dc978f1 100644 --- a/superset-frontend/src/core/sqlLab/sqlLab.test.ts +++ b/superset-frontend/src/core/sqlLab/sqlLab.test.ts @@ -576,7 +576,8 @@ test('getTabs leaves backendId undefined when the editor has no tabViewId', () = test('getTabs surfaces the editor tabViewId as the tab backendId', () => { // Stamp a backend id onto the editor and confirm it flows through to the tab. - (mockStore.getState().sqlLab.queryEditors[0] as any).tabViewId = 'backend-42'; + (mockStore.getState().sqlLab.queryEditors[0] as QueryEditor).tabViewId = + 'backend-42'; const tab = sqlLab.getCurrentTab(); expect(tab).toBeDefined(); diff --git a/superset-frontend/src/extensions/ExtensionsStartup.test.tsx b/superset-frontend/src/extensions/ExtensionsStartup.test.tsx index 73efff572c0..5c6418a0b88 100644 --- a/superset-frontend/src/extensions/ExtensionsStartup.test.tsx +++ b/superset-frontend/src/extensions/ExtensionsStartup.test.tsx @@ -292,11 +292,11 @@ test('renders children and surfaces a warning toast when init fails', async () = // The failure must reach the user as a warning toast rather than being // swallowed silently. await waitFor(() => { - const toasts = (store.getState() as any).messageToasts; + const { messageToasts } = store.getState() as { + messageToasts: { text: string }[]; + }; expect( - toasts.some((toast: { text: string }) => - /Extensions failed to load/.test(toast.text), - ), + messageToasts.some(toast => /Extensions failed to load/.test(toast.text)), ).toBe(true); }); diff --git a/superset-frontend/src/extensions/ExtensionsStartup.tsx b/superset-frontend/src/extensions/ExtensionsStartup.tsx index 6c0eb457544..8d8b65e6aa1 100644 --- a/superset-frontend/src/extensions/ExtensionsStartup.tsx +++ b/superset-frontend/src/extensions/ExtensionsStartup.tsx @@ -80,7 +80,7 @@ const ExtensionsStartup: React.FC<{ children?: React.ReactNode }> = ({ 'Extensions initialized successfully.', ), ) - .catch(error => { + .catch((error: unknown) => { supersetCore.utils.logging.error( 'Error setting up extensions:', error,