Skip to content

Commit

Permalink
add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
yoyo837 committed Apr 29, 2020
1 parent 2664630 commit cc00d40
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,9 @@ exports[`Tooltip should hide when mouse leave antd disabled component Switch 1`]
</button>
</span>
`;

exports[`Tooltip should works for mismatch placement 1`] = `
<span>
Hello world!
</span>
`;
15 changes: 15 additions & 0 deletions components/tooltip/__tests__/tooltip.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,4 +297,19 @@ describe('Tooltip', () => {
await sleep(500);
expect(wrapper.instance().getPopupDomNode().className).toContain('placement-topRight');
});

it('should works for mismatch placement', async () => {
const wrapper = mount(
<Tooltip
title="xxxxx"
align={{
points: ['aa', 'bb'],
}}
>
<span>Hello world!</span>
</Tooltip>,
);

expect(wrapper.render()).toMatchSnapshot();
});
});

0 comments on commit cc00d40

Please sign in to comment.