You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
797 B

import React from 'react';
7 years ago
import { mount } from 'enzyme';
import Popover from '..';
import mountTest from '../../../tests/shared/mountTest';
describe('Popover', () => {
mountTest(Popover);
it('should show overlay when trigger is clicked', () => {
7 years ago
const popover = mount(
<Popover content="console.log('hello world')" title="code" trigger="click">
<span>show me your code</span>
6 years ago
</Popover>,
);
expect(popover.instance().getPopupDomNode()).toBe(null);
7 years ago
popover.find('span').simulate('click');
const popup = popover.instance().getPopupDomNode();
expect(popup).not.toBe(null);
expect(popup.className).toContain('ant-popover-placement-top');
7 years ago
expect(popup.innerHTML).toMatchSnapshot();
expect(popup.innerHTML).toMatchSnapshot();
});
});