mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 02:59:58 +08:00
update test
This commit is contained in:
parent
a068e58dd4
commit
d900bec8b4
@ -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",
|
||||
|
@ -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>/);
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user