update test

This commit is contained in:
afc163 2015-12-07 15:43:49 +08:00
parent a068e58dd4
commit d900bec8b4
2 changed files with 5 additions and 7 deletions

View File

@ -90,7 +90,6 @@
"eslint-plugin-babel": "^3.0.0",
"eslint-plugin-markdown-antd": "0.0.0",
"eslint-plugin-react": "^3.3.1",
"expect.js": "~0.3.1",
"extract-text-webpack-plugin": "^0.9.1",
"gh-pages": "^0.5.0",
"history": "^1.13.1",

View File

@ -1,5 +1,4 @@
import React from 'react';
import expect from 'expect.js';
import TestUtils from 'react-addons-test-utils';
jest.dontMock('../components/popover/index');
@ -14,16 +13,16 @@ describe('Popover', function() {
</Popover>
);
expect(popover.getPopupDomNode()).to.be(undefined);
expect(popover.getPopupDomNode()).toBe(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(/<div class="ant-popover-title".*?>code<\/div>/);
expect(popup.innerHTML).to.match(/<div class="ant-popover-content".*?>console\.log\('hello world'\)<\/div>/);
expect(popup).not.toBe(undefined);
expect(popup.className).toContain('ant-popover-placement-top');
expect(popup.innerHTML).toMatch(/<div class="ant-popover-title".*?>code<\/div>/);
expect(popup.innerHTML).toMatch(/<div class="ant-popover-content".*?>console\.log\('hello world'\)<\/div>/);
});
});