Skip to content

Commit

Permalink
fix: add test
Browse files Browse the repository at this point in the history
  • Loading branch information
madalena-campos-brisa committed Sep 27, 2023
1 parent 947366b commit 3a534e9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions projects/ion/src/lib/alert/alert.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,17 @@ describe('AlertComponent', () => {
expect(element).toHaveClass('without-background');
});

it('should render with description', async () => {
const description = 'Testing description';
const element = await sut({ ...defaultValue, description });
expect(element).toHaveTextContent(description);
});

it('should render without radius', async () => {
const element = await sut({ ...defaultValue, noRadius: true });
expect(element).toHaveClass('no-radius');
});

describe('With a string provided', () => {
it('Should have an alert message', async () => {
expect(await sut()).toHaveTextContent(defaultValue.message as string);
Expand Down
2 changes: 2 additions & 0 deletions projects/ion/src/lib/core/types/alert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import { StatusType } from './status';

export interface IonAlertProps {
message: string | TemplateRef<void>;
description?: string;
type?: StatusType;
closable?: boolean;
hideBackground?: boolean;
noRadius?: boolean;
}

0 comments on commit 3a534e9

Please sign in to comment.