refactor: icon to icons for basicerror componenet (#15336)

* initial commit

* initial commit

* fix test

* lint fix

* Update superset-frontend/src/components/ErrorMessage/BasicErrorAlert.tsx

Co-authored-by: David Aaron Suddjian <1858430+suddjian@users.noreply.github.com>

* lint

Co-authored-by: David Aaron Suddjian <1858430+suddjian@users.noreply.github.com>
This commit is contained in:
Phillip Kelley-Dotson
2021-06-24 09:37:13 -07:00
committed by GitHub
parent 680b447bc4
commit a477505291
2 changed files with 10 additions and 15 deletions

View File

@@ -43,11 +43,9 @@ test('should render', () => {
test('should render warning icon', () => {
render(<BasicErrorAlert {...mockedProps} />);
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(<BasicErrorAlert {...errorProps} />);
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', () => {