diff --git a/redisinsight/ui/src/components/base/tooltip/RITooltip.tsx b/redisinsight/ui/src/components/base/tooltip/RITooltip.tsx index b726fa4ffc..1cab839e0c 100644 --- a/redisinsight/ui/src/components/base/tooltip/RITooltip.tsx +++ b/redisinsight/ui/src/components/base/tooltip/RITooltip.tsx @@ -23,7 +23,9 @@ export const RiTooltip = ({ } + content={ + (content || title) && + } placement={position} openDelayDuration={delay} > diff --git a/redisinsight/ui/src/components/base/tooltip/RiTooltip.spec.tsx b/redisinsight/ui/src/components/base/tooltip/RiTooltip.spec.tsx index 8261035ea9..75c4b9bc76 100644 --- a/redisinsight/ui/src/components/base/tooltip/RiTooltip.spec.tsx +++ b/redisinsight/ui/src/components/base/tooltip/RiTooltip.spec.tsx @@ -62,9 +62,9 @@ describe('RiTooltip', () => { expect(screen.queryByRole('heading')).not.toBeInTheDocument() }) - it('should not render tooltip when content is not provided', async () => { + it('should not render tooltip when content and title are not provided', async () => { render( - + , ) @@ -119,8 +119,12 @@ describe('RiTooltip', () => { }) await waitForRiTooltipVisible() - expect(screen.getAllByTestId('tooltip-custom-content')[0]).toBeInTheDocument() - expect(screen.getAllByText('Custom content with HTML')[0]).toBeInTheDocument() + expect( + screen.getAllByTestId('tooltip-custom-content')[0], + ).toBeInTheDocument() + expect( + screen.getAllByText('Custom content with HTML')[0], + ).toBeInTheDocument() expect( screen.getAllByRole('button', { name: 'Hover me' })[0], ).toBeInTheDocument()