mirror of
https://github.com/apache/superset.git
synced 2026-04-22 09:35:23 +00:00
chore: Replaces Icon with Icons component - iteration 1 (#14469)
This commit is contained in:
committed by
GitHub
parent
4e6169e0f9
commit
9deb7aa3c1
@@ -31,25 +31,25 @@ const defaultProps = {
|
||||
options: { string: { column_name: 'Column' } },
|
||||
};
|
||||
|
||||
test('renders with default props', () => {
|
||||
test('renders with default props', async () => {
|
||||
render(<DndSelectLabel {...defaultProps} />, { useDnd: true });
|
||||
expect(screen.getByText('Drop columns')).toBeInTheDocument();
|
||||
expect(await screen.findByText('Drop columns')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('renders ghost button when empty', () => {
|
||||
test('renders ghost button when empty', async () => {
|
||||
const ghostButtonText = 'Ghost button text';
|
||||
render(
|
||||
<DndSelectLabel {...defaultProps} ghostButtonText={ghostButtonText} />,
|
||||
{ useDnd: true },
|
||||
);
|
||||
expect(screen.getByText(ghostButtonText)).toBeInTheDocument();
|
||||
expect(await screen.findByText(ghostButtonText)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('renders values', () => {
|
||||
test('renders values', async () => {
|
||||
const values = 'Values';
|
||||
const valuesRenderer = () => <span>{values}</span>;
|
||||
render(<DndSelectLabel {...defaultProps} valuesRenderer={valuesRenderer} />, {
|
||||
useDnd: true,
|
||||
});
|
||||
expect(screen.getByText(values)).toBeInTheDocument();
|
||||
expect(await screen.findByText(values)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
@@ -26,7 +26,7 @@ import {
|
||||
HeaderContainer,
|
||||
} from 'src/explore/components/controls/OptionControls';
|
||||
import { DatasourcePanelDndItem } from 'src/explore/components/DatasourcePanel/types';
|
||||
import Icon from 'src/components/Icon';
|
||||
import Icons from 'src/components/Icons';
|
||||
import { DndColumnSelectProps } from './types';
|
||||
|
||||
export default function DndSelectLabel<T, O>({
|
||||
@@ -54,7 +54,7 @@ export default function DndSelectLabel<T, O>({
|
||||
function renderGhostButton() {
|
||||
return (
|
||||
<AddControlLabel cancelHover>
|
||||
<Icon name="plus-small" color={theme.colors.grayscale.light1} />
|
||||
<Icons.PlusSmall iconColor={theme.colors.grayscale.light1} />
|
||||
{t(props.ghostButtonText || 'Drop columns')}
|
||||
</AddControlLabel>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user