Skip to content

Commit cf8c43f

Browse files
committed
chore: add unit tests for button
1 parent a7f6af5 commit cf8c43f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/components/Button/__test__/Button.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ describe('Button component', () => {
6464
});
6565

6666
it('applies the correct rounded class based on the "rounded" prop', () => {
67-
const { container } = render(<Button rounded="lg">Test Button</Button>);
68-
expect(container.firstChild).toHaveClass('deriv-button__rounded--lg');
67+
const { container } = render(<Button rounded="md">Test Button</Button>);
68+
expect(container.firstChild).toHaveClass('deriv-button__rounded--md');
6969
});
7070

7171
it('shows the icon when provided and not loading', () => {

lib/components/Button/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export const Button = ({
8484
className,
8585
)}
8686
disabled={rest.disabled || isLoading}
87-
aria-label={rest.children}
87+
aria-label={rest.children && typeof rest.children === 'string' ? rest.children : ''}
8888
{...rest}
8989
>
9090
{isLoading && (

0 commit comments

Comments
 (0)