Skip to content

Commit

Permalink
Add suggested unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
ciampo committed Jan 18, 2024
1 parent caeb992 commit 82a5f73
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/components/src/tooltip/test/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,17 @@ describe( 'Tooltip', () => {
screen.queryByRole( 'button', { description: 'tooltip text' } )
).not.toBeInTheDocument();
} );

it( 'should not leak Tooltip props to the tooltip anchor', () => {
render(
<Tooltip data-foo>
<button>Anchor</button>
</Tooltip>
);
expect(
screen.getByRole( 'button', { name: 'Anchor' } )
).not.toHaveAttribute( 'data-foo' );
} );
} );

describe( 'keyboard focus', () => {
Expand Down

0 comments on commit 82a5f73

Please sign in to comment.