Skip to content

Commit

Permalink
Add test for prop priority
Browse files Browse the repository at this point in the history
  • Loading branch information
mirka committed Jun 23, 2023
1 parent d03ba97 commit 9ec488a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/components/src/button/test/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,14 @@ describe( 'Button', () => {
render( <Button isSmall /> );
expect( screen.getByRole( 'button' ) ).toHaveClass( 'is-small' );
} );

it( 'should prioritize the `size` prop over `isSmall`', () => {
render( <Button size="compact" isSmall /> );
expect( screen.getByRole( 'button' ) ).not.toHaveClass(
'is-small'
);
expect( screen.getByRole( 'button' ) ).toHaveClass( 'is-compact' );
} );
} );

describe( 'static typing', () => {
Expand Down

0 comments on commit 9ec488a

Please sign in to comment.