diff --git a/superset-frontend/src/explore/components/controls/CollectionControl/CollectionControl.test.tsx b/superset-frontend/src/explore/components/controls/CollectionControl/CollectionControl.test.tsx index 1bd518e9511..09cca7d7f83 100644 --- a/superset-frontend/src/explore/components/controls/CollectionControl/CollectionControl.test.tsx +++ b/superset-frontend/src/explore/components/controls/CollectionControl/CollectionControl.test.tsx @@ -134,6 +134,14 @@ test('Should have SortableDragger icon', async () => { expect(await screen.findByLabelText('Drag to reorder')).toBeVisible(); }); +test('Drag activator exposes aria-label="Drag to reorder"', async () => { + const props = createProps(); + render(); + const dragActivator = await screen.findByLabelText('Drag to reorder'); + expect(dragActivator).toHaveAttribute('aria-label', 'Drag to reorder'); + expect(dragActivator.tagName).toBe('BUTTON'); +}); + test('Should call Control component', async () => { const props = createProps(); render(); diff --git a/superset-frontend/src/explore/components/controls/CollectionControl/index.tsx b/superset-frontend/src/explore/components/controls/CollectionControl/index.tsx index 6e5edb1a866..deacd450c63 100644 --- a/superset-frontend/src/explore/components/controls/CollectionControl/index.tsx +++ b/superset-frontend/src/explore/components/controls/CollectionControl/index.tsx @@ -17,7 +17,7 @@ * under the License. */ import React, { useCallback, useMemo } from 'react'; -import { IconTooltip, List } from '@superset-ui/core/components'; +import { Button, IconTooltip, List } from '@superset-ui/core/components'; import { nanoid } from 'nanoid'; import { t } from '@apache-superset/core/translation'; import { useTheme, type SupersetTheme } from '@apache-superset/core/theme'; @@ -124,29 +124,18 @@ function SortableItem({ paddingInline: theme.sizeUnit * 6, })} > - + +