Merge pull request #21185 from ant-design/upgrade-jest

chore: 🆙 upgrade jest 25
This commit is contained in:
偏右 2020-02-04 18:54:00 +08:00 committed by GitHub
commit 4984838cbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 6 deletions

View File

@ -51,7 +51,7 @@ describe('Input.Password', () => {
});
it('should keep focus state', () => {
const wrapper = mount(<Input.Password defaultValue="111" autoFocus />);
const wrapper = mount(<Input.Password defaultValue="111" autoFocus />, { attachTo: document.body });
expect(document.activeElement).toBe(
wrapper
.find('input')
@ -72,6 +72,7 @@ describe('Input.Password', () => {
.at(0)
.getDOMNode(),
);
wrapper.unmount();
});
// https://github.com/ant-design/ant-design/issues/20541

View File

@ -51,7 +51,7 @@ describe('Input', () => {
expect(errorSpy).not.toHaveBeenCalled();
});
it('trigger warning', () => {
const wrapper = mount(<Input />);
const wrapper = mount(<Input />, { attachTo: document.body });
wrapper
.find('input')
.instance()
@ -62,6 +62,7 @@ describe('Input', () => {
expect(errorSpy).toHaveBeenCalledWith(
'Warning: [antd: Input] When Input is focused, dynamic add or remove prefix / suffix will make it lose focus caused by dom structure change. Read more: https://ant.design/components/input/#FAQ',
);
wrapper.unmount();
});
});
});
@ -327,7 +328,7 @@ describe('Input allowClear', () => {
});
it('should focus input after clear', () => {
const wrapper = mount(<Input allowClear defaultValue="111" />);
const wrapper = mount(<Input allowClear defaultValue="111" />, { attachTo: document.body });
wrapper
.find('.ant-input-clear-icon')
.at(0)
@ -338,6 +339,7 @@ describe('Input allowClear', () => {
.at(0)
.getDOMNode(),
);
wrapper.unmount();
});
it('should not support allowClear when it is disabled', () => {
@ -425,7 +427,7 @@ describe('TextArea allowClear', () => {
});
it('should focus textarea after clear', () => {
const wrapper = mount(<TextArea allowClear defaultValue="111" />);
const wrapper = mount(<TextArea allowClear defaultValue="111" />, { attachTo: document.body });
wrapper
.find('.ant-input-textarea-clear-icon')
.at(0)
@ -436,6 +438,7 @@ describe('TextArea allowClear', () => {
.at(0)
.getDOMNode(),
);
wrapper.unmount();
});
it('should not support allowClear when it is disabled', () => {

View File

@ -116,7 +116,7 @@
"rc-pagination": "~1.20.13",
"rc-picker": "^0.0.1-rc.5",
"rc-progress": "~2.5.0",
"rc-rate": "~2.5.0",
"rc-rate": "~2.5.1",
"rc-resize-observer": "^0.1.0",
"rc-select": "~10.0.0-alpha.36",
"rc-slider": "~9.2.0",
@ -196,7 +196,7 @@
"ignore-emit-webpack-plugin": "^2.0.2",
"immutability-helper": "^3.0.0",
"intersection-observer": "^0.7.0",
"jest": "^24.8.0",
"jest": "^25.1.0",
"jquery": "^3.4.1",
"jsdom": "^16.0.0",
"jsonml.js": "^0.1.0",