mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-22 22:48:29 +08:00
24 lines
704 B
JavaScript
24 lines
704 B
JavaScript
import React from 'react';
|
|
import { mount } from 'enzyme';
|
|
import Popover from '..';
|
|
|
|
describe('Popover', () => {
|
|
it('should show overlay when trigger is clicked', () => {
|
|
const popover = mount(
|
|
<Popover content="console.log('hello world')" title="code" trigger="click">
|
|
<span>show me your code</span>
|
|
</Popover>
|
|
);
|
|
|
|
expect(popover.node.getPopupDomNode()).toBe(null);
|
|
|
|
popover.find('span').simulate('click');
|
|
|
|
const popup = popover.node.getPopupDomNode();
|
|
expect(popup).not.toBe(null);
|
|
expect(popup.className).toContain('ant-popover-placement-top');
|
|
expect(popup.innerHTML).toMatchSnapshot();
|
|
expect(popup.innerHTML).toMatchSnapshot();
|
|
});
|
|
});
|