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


##########
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:
   Restored in 0df9742037. Re-added the filter control type-gating tests to 
`DndFilterSelect.test.tsx` using the `captureDroppableData` + `simulateDrop` 
pattern from `DndMetricSelect.test.tsx`: a column not part of the simple column 
selection is rejected, and both `disallow_adhoc_metrics` scenarios (saved 
metric accepted, non-saved/column rejected) are driven through the production 
`resolveDragEnd` dispatcher so the real `accept`/`canDrop` gating is exercised.



##########
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:
   Restored in 0df9742037. Re-added the dragging-state propagation coverage to 
`ExploreContainer.test.tsx`: it captures the provider's `onDragStart` and 
exercises the `dragIndex` gate directly, asserting that `DraggingContext` is 
set for a DatasourcePanel drag but NOT for an in-list reorder (the 
`!('dragIndex' in data)` branch in `handleDragStart`). So that branch is 
covered again rather than just the initial `false` state.



-- 
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