This commit is contained in:
Munyaneza Armel 2022-10-12 05:03:05 +00:00
parent fe16b749b6
commit 65c3a6df03
2 changed files with 2 additions and 3 deletions

View File

@ -46,7 +46,7 @@ const Alert: FunctionComponent<ComponentProps> = (
<div className="row">
<div className="col-xl-12">
<div
data-testid="test-id"
data-testid="test-id"
className={`alert-label-icon flex label-arrow alert ${cssClass} alert-dismissible fade show ${
props.onClick ? 'pointer' : ''
}`}

View File

@ -22,11 +22,10 @@ describe('alert tests', () => {
expect(handleClose).toBeCalled;
});
test('it should show icon when alert type is equal to success', () => {
render(<Alert type={AlertType.SUCCESS} />);
render(<Alert type={AlertType.SUCCESS} />);
expect(Icon).toBeInTheDocument;
const testId: HTMLElement = screen.getByTestId('test-id');
expect(testId).toHaveClass('alert-success');
});
test('it should show icon when alert type is equal to info', () => {
render(<Alert type={AlertType.INFO} />);