Skip to content

Commit

Permalink
Tooltip: Add test for classname leakage
Browse files Browse the repository at this point in the history
  • Loading branch information
mirka committed Jan 24, 2024
1 parent 93cc5d6 commit 50da201
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/components/src/tooltip/test/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -487,5 +487,18 @@ describe( 'Tooltip', () => {
).not.toBeInTheDocument()
);
} );

it( 'should not leak Tooltip component classname to the anchor element', () => {
render(
<Tooltip>
<Tooltip>
<button>Anchor</button>
</Tooltip>
</Tooltip>
);
expect(
screen.getByRole( 'button', { name: 'Anchor' } )
).not.toHaveClass( 'components-tooltip' );
} );
} );
} );

0 comments on commit 50da201

Please sign in to comment.