aminghadersohi commented on code in PR #37880:
URL: https://github.com/apache/superset/pull/37880#discussion_r3365801791


##########
superset-frontend/src/explore/components/ExploreContainer/ExploreContainer.test.tsx:
##########
@@ -57,69 +53,29 @@ test('should render children', () => {
     <ExploreContainer>
       <MockChildren />
     </ExploreContainer>,
-    { useRedux: true, useDnd: true },
+    { useRedux: true },
   );
   expect(getByTestId('mock-children')).toBeInTheDocument();
   expect(getByText('not dragging')).toBeInTheDocument();
 });
 
-test('should only propagate dragging state when dragging the panel option', () 
=> {
-  const defaultProps = {
-    label: <span>Test label</span>,
-    tooltipTitle: 'This is a tooltip title',
-    onRemove: jest.fn(),
-    onMoveLabel: jest.fn(),
-    onDropLabel: jest.fn(),
-    type: 'test',
-    index: 0,
-  };
+test('should initially have dragging set to false', () => {

Review Comment:
   **NIT:** The replaced test only checks the initial `false` state; the 
removed test (`should only propagate dragging state when dragging the panel 
option`) verified that only DatasourcePanel drags — not in-list reorders — set 
`DraggingContext`. Production code handles this correctly (`handleDragStart` 
gates on `!('dragIndex' in data)`), so no regression, but the test branch is 
now untested. Low priority follow-up.



##########
superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndFilterSelect.test.tsx:
##########
@@ -181,78 +174,8 @@ test('renders options with adhoc metric', async () => {
   ).toBeInTheDocument();
 });
 
-test('cannot drop a column that is not part of the simple column selection', 
() => {
-  const adhocMetric = new AdhocMetric({
-    expression: 'AVG(birth_names.num)',
-    metric_name: 'avg__num',
-  });
-  const { getByTestId, getAllByTestId } = render(
-    <>
-      <DatasourcePanelDragOption
-        value={{ column_name: 'order_date' }}
-        type={DndItemType.Column}
-      />
-      <DatasourcePanelDragOption
-        value={{ column_name: 'address_line1' }}
-        type={DndItemType.Column}
-      />
-      <DatasourcePanelDragOption
-        value={{
-          metric_name: 'metric_a',
-          expression: 'AGG(metric_a)',
-          uuid: '1',
-        }}
-        type={DndItemType.Metric}
-      />
-      {setup({
-        formData: {
-          ...baseFormData,
-          metrics: [adhocMetric as unknown as QueryFormMetric],
-        },
-        columns: [{ column_name: 'order_date' }],
-      })}
-    </>,
-    {
-      useDnd: true,
-      store,
-    },
-  );
-
-  const selections = getAllByTestId('DatasourcePanelDragOption');
-  const acceptableColumn = selections[0];
-  const unacceptableColumn = selections[1];
-  const metricType = selections[2];
-  const currentMetric = getByTestId('dnd-labels-container');
-
-  fireEvent.dragStart(unacceptableColumn);
-  fireEvent.dragOver(currentMetric);
-  fireEvent.drop(currentMetric);
-
-  expect(screen.queryByTestId('filter-edit-popover')).not.toBeInTheDocument();
-
-  fireEvent.dragStart(acceptableColumn);
-  fireEvent.dragOver(currentMetric);
-  fireEvent.drop(currentMetric);
-
-  const filterConfigPopup = screen.getByTestId('filter-edit-popover');
-  
expect(within(filterConfigPopup).getByText('order_date')).toBeInTheDocument();
-
-  fireEvent.keyDown(filterConfigPopup, {
-    key: 'Escape',
-    code: 'Escape',
-    keyCode: 27,
-    charCode: 27,
-  });
-  expect(screen.queryByTestId('filter-edit-popover')).not.toBeInTheDocument();
-
-  fireEvent.dragStart(metricType);
-  fireEvent.dragOver(currentMetric);
-  fireEvent.drop(currentMetric);
-
-  expect(
-    within(screen.getByTestId('filter-edit-popover')).getByTestId('react-ace'),
-  ).toHaveTextContent('AGG(metric_a)');
-});
+// Note: Drag-and-drop tests removed - @dnd-kit uses pointer events instead of

Review Comment:
   **MEDIUM (non-blocking):** Three behavioral tests for type-gating (`cannot 
drop a column that is not part of the simple column selection`, the two 
`disallow_adhoc_metrics` scenarios) were removed here. `dndTestUtils.ts`'s 
`captureDroppableData` + `simulateDrop` pattern — already used in 
`DndMetricSelect.test.tsx` — supports exactly this. Worth a follow-up to 
restore coverage for the filter control's accept/canDrop gating.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to