Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
mcwong committed Dec 12, 2022
1 parent ac27125 commit f6bc2d0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions components/typography/__tests__/copy.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,5 +265,21 @@ describe('Typography copy', () => {
expect(spy.mock.calls[0][0]).toEqual(nextText);
jest.useRealTimers();
});

it('tooltip should hide when mouse leave', () => {
const { container } = render(
<Base component="p" copyable>
test copy
</Base>,
);

expect(container.getElementsByTagName('span')).toHaveLength(1);
const button = container.getElementsByTagName('span')[0];

fireEvent.mouseOver(button);
expect(container.querySelector('.ant-tooltip-open')).not.toBeNull();
fireEvent.mouseLeave(button);
expect(container.querySelector('.ant-tooltip-open')).toBeNull();
});
});
});

0 comments on commit f6bc2d0

Please sign in to comment.