You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ms...@apache.org on 2026/07/16 16:32:04 UTC

(superset) 14/15: fix: keep user-event 12 call sites and move the ReactText alias

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

msyavuz pushed a commit to branch msyavuz/chore/react-19
in repository https://gitbox.apache.org/repos/asf/superset.git

commit cc450b91bb2dad45a70610223cfa36a88c48684c
Author: Mehmet Salih Yavuz <sa...@proton.me>
AuthorDate: Thu Jul 16 18:35:07 2026 +0300

    fix: keep user-event 12 call sites and move the ReactText alias
    
    The local ReactText alias (React 19 removed the type) sat between imports,
    tripping oxlint's import/first — move it below them.
    
    Restore userEvent.paste(element, text) in two tests: they had been migrated
    to user-event 14's one-argument signature, and the v14 bump is not part of
    this branch.
---
 superset-frontend/packages/superset-ui-chart-controls/src/types.ts   | 5 +++--
 .../controls/DndColumnSelectControl/DndMetricSelect.test.tsx         | 3 +--
 .../AdhocFilterEditPopoverSqlTabContent.test.tsx                     | 3 +--
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/types.ts b/superset-frontend/packages/superset-ui-chart-controls/src/types.ts
index 92163f1a14a..1c7ea77b14d 100644
--- a/superset-frontend/packages/superset-ui-chart-controls/src/types.ts
+++ b/superset-frontend/packages/superset-ui-chart-controls/src/types.ts
@@ -19,8 +19,6 @@
  */
 import { ReactElement, ReactNode, ComponentType } from 'react';
 
-type ReactText = string | number;
-
 import type {
   AdhocColumn,
   Column,
@@ -41,6 +39,9 @@ import type {
 import { GenericDataType } from '@apache-superset/core/common';
 import { sharedControls, sharedControlComponents } from './shared-controls';
 
+// React 19 removed the ReactText type.
+type ReactText = string | number;
+
 export type { Metric } from '@superset-ui/core';
 export type { ControlComponentProps } from './shared-controls/components/types';
 
diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.test.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.test.tsx
index e3a1e214565..3b8e64db03e 100644
--- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.test.tsx
+++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.test.tsx
@@ -569,8 +569,7 @@ test('title changes on custom SQL text change', async () => {
   // Changing the ACE editor via pasting, since the component
   // handles the textarea value internally, and changing it doesn't
   // trigger the onChange
-  textArea.focus();
-  await userEvent.paste('New metric');
+  await userEvent.paste(textArea, 'New metric');
 
   await waitFor(() => {
     expect(
diff --git a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSqlTabContent/AdhocFilterEditPopoverSqlTabContent.test.tsx b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSqlTabContent/AdhocFilterEditPopoverSqlTabContent.test.tsx
index ee50bb5fea3..f5b1eee033f 100644
--- a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSqlTabContent/AdhocFilterEditPopoverSqlTabContent.test.tsx
+++ b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSqlTabContent/AdhocFilterEditPopoverSqlTabContent.test.tsx
@@ -105,8 +105,7 @@ test('calls onChange when the SQL expression changes', async () => {
   const sqlEditor = screen.getByRole('textbox');
   expect(sqlEditor).toBeInTheDocument();
   userEvent.clear(sqlEditor);
-  sqlEditor.focus();
-  await userEvent.paste(input);
+  await userEvent.paste(sqlEditor, input);
   await new Promise(resolve => setTimeout(resolve, 0));
   expect(onChange).toHaveBeenCalledWith(
     expect.objectContaining({ sqlExpression: input }),