import React from 'react'; import expect from 'expect.js'; import TestUtils from 'react-addons-test-utils'; jest.dontMock('../components/popover/index'); const Popover = require('../components/popover/index'); describe('Popover', function() { it.only('should show overlay when trigger is clicked', () => { const popover = TestUtils.renderIntoDocument( show me your code ); expect(popover.getPopupDomNode()).to.be(undefined); TestUtils.Simulate.click( TestUtils.findRenderedDOMComponentWithTag(popover, 'a') ); const popup = popover.getPopupDomNode(); expect(popup).not.to.be(undefined); expect(popup.className).to.contain('ant-popover-placement-top'); expect(popup.innerHTML).to.match(/
code<\/div>/); expect(popup.innerHTML).to.match(/
console\.log\('hello world'\)<\/div>/); }); });