diff --git a/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.test.tsx b/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.test.tsx index 99db37d92796..22335213dc28 100644 --- a/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.test.tsx +++ b/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.test.tsx @@ -43,11 +43,9 @@ test('should render', () => { test('should render warning icon', () => { render(); - expect(screen.getByTestId('icon')).toBeInTheDocument(); - expect(screen.getByTestId('icon')).toHaveAttribute( - 'data-name', - 'warning-solid', - ); + expect( + screen.getByRole('img', { name: 'warning-solid' }), + ).toBeInTheDocument(); }); test('should render error icon', () => { @@ -56,11 +54,7 @@ test('should render error icon', () => { level: 'error' as ErrorLevel, }; render(); - expect(screen.getByTestId('icon')).toBeInTheDocument(); - expect(screen.getByTestId('icon')).toHaveAttribute( - 'data-name', - 'error-solid', - ); + expect(screen.getByRole('img', { name: 'error-solid' })).toBeInTheDocument(); }); test('should render the error title', () => { diff --git a/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.tsx b/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.tsx index 6c460096ad7d..0d5d99305dc6 100644 --- a/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.tsx +++ b/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.tsx @@ -18,7 +18,7 @@ */ import React from 'react'; import { styled, supersetTheme } from '@superset-ui/core'; -import Icon from '../Icon'; +import Icons from 'src/components/Icons'; import { ErrorLevel } from './types'; const StyledContainer = styled.div<{ level: ErrorLevel }>` @@ -56,10 +56,11 @@ export default function BasicErrorAlert({ }: BasicErrorAlertProps) { return ( - + {level === 'error' ? ( + + ) : ( + + )} {title}

{body}