You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ru...@apache.org on 2025/08/05 00:15:58 UTC

(superset) 01/01: fix: Fix pre-commit issues in AsyncSelect test

This is an automated email from the ASF dual-hosted git repository.

rusackas pushed a commit to branch pr-34306
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 8689673463a4ff44d7b9f2330c6842e7cfbcbcd4
Author: Evan Rusackas <ev...@rusackas.com>
AuthorDate: Mon Aug 4 17:15:43 2025 -0700

    fix: Fix pre-commit issues in AsyncSelect test
    
    - Add proper TypeScript types to slowLoadOptions mock function
    - Import SelectOptionsTypePage type for proper typing
    - Fix function signature to match expected SelectOptionsPagePromise type
---
 .../src/components/Select/AsyncSelect.test.tsx              | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/superset-frontend/packages/superset-ui-core/src/components/Select/AsyncSelect.test.tsx b/superset-frontend/packages/superset-ui-core/src/components/Select/AsyncSelect.test.tsx
index 5575106698..16b32cc8c6 100644
--- a/superset-frontend/packages/superset-ui-core/src/components/Select/AsyncSelect.test.tsx
+++ b/superset-frontend/packages/superset-ui-core/src/components/Select/AsyncSelect.test.tsx
@@ -26,6 +26,7 @@ import {
   within,
 } from '@superset-ui/core/spec';
 import { AsyncSelect } from '.';
+import type { SelectOptionsTypePage } from './types';
 
 const ARIA_LABEL = 'Test';
 const NEW_OPTION = 'Kyle';
@@ -514,20 +515,20 @@ test('opens the select without any data', async () => {
 test('displays the loading indicator when opening', async () => {
   // Use an async function that takes time to resolve
   const slowLoadOptions = jest.fn(
-    () =>
-      new Promise(resolve => {
+    (search: string, page: number, pageSize: number) =>
+      new Promise<SelectOptionsTypePage>(resolve => {
         setTimeout(() => {
-          resolve(loadOptions());
+          resolve(loadOptions(search, page, pageSize));
         }, 100);
       }),
   );
-  
+
   render(<AsyncSelect {...defaultProps} options={slowLoadOptions} />);
   await userEvent.click(getSelect());
-  
+
   // The loading state should be shown when the dropdown opens
   expect(screen.getByText(LOADING)).toBeInTheDocument();
-  
+
   // After loading completes, the loading text should disappear
   await waitFor(() => {
     expect(screen.queryByText(LOADING)).not.toBeInTheDocument();