test: Fix act errors in DatasourceControl test (#22845)

This commit is contained in:
Lyndsi Kay Williams 2023-01-25 07:36:05 -06:00 committed by GitHub
parent 050cbe938f
commit ddd5cd3aec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 0 deletions

View File

@ -27,6 +27,25 @@ import DatasourceControl from '.';
const SupersetClientGet = jest.spyOn(SupersetClient, 'get');
jest.mock('src/components/Icons/Icon', () => ({
__esModule: true,
default: ({
fileName,
role,
...rest
}: {
fileName: string;
role: string;
}) => (
<span
role={role ?? 'img'}
aria-label={fileName.replace('_', '-')}
{...rest}
/>
),
StyledIcon: () => <span />,
}));
const createProps = (overrides: JsonObject = {}) => ({
hovered: false,
type: 'DatasourceControl',