diff --git a/components/tabs/__tests__/index.test.js b/components/tabs/__tests__/index.test.js
index 806291eb10..5853702c98 100644
--- a/components/tabs/__tests__/index.test.js
+++ b/components/tabs/__tests__/index.test.js
@@ -1,5 +1,5 @@
import React from 'react';
-import { mount, render } from 'enzyme';
+import { render, fireEvent } from '../../../tests/utils';
import Tabs from '..';
import mountTest from '../../../tests/shared/mountTest';
import rtlTest from '../../../tests/shared/rtlTest';
@@ -24,7 +24,7 @@ describe('Tabs', () => {
beforeEach(() => {
handleEdit = jest.fn();
- wrapper = mount(
+ const { container } = render(
foo
@@ -34,52 +34,53 @@ describe('Tabs', () => {
{false}
,
);
+ wrapper = container;
});
it('add card', () => {
- wrapper.find('.ant-tabs-nav-add').first().simulate('click');
+ fireEvent.click(wrapper.querySelector('.ant-tabs-nav-add'));
expect(handleEdit.mock.calls[0][1]).toBe('add');
});
it('remove card', () => {
- wrapper.find('.anticon-close').simulate('click');
+ fireEvent.click(wrapper.querySelector('.anticon-close'));
expect(handleEdit).toHaveBeenCalledWith('1', 'remove');
});
it('validateElement', () => {
- expect(wrapper.find('.ant-tabs-tab').length).toBe(1);
+ expect(wrapper.querySelectorAll('.ant-tabs-tab').length).toBe(1);
});
});
describe('tabPosition', () => {
it('remove card', () => {
- const wrapper = render(
+ const { container } = render(
foo
,
);
- expect(wrapper).toMatchSnapshot();
+ expect(container.firstChild).toMatchSnapshot();
});
});
describe('renderTabBar', () => {
it('custom-tab-bar', () => {
- const wrapper = render(
+ const { container } = render(
custom-tab-bar
}>
foo
,
);
- expect(wrapper).toMatchSnapshot();
+ expect(container.firstChild).toMatchSnapshot();
});
});
it('warning for onNextClick', () => {
const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
- mount(
{}} />);
+ render( {}} />);
expect(errorSpy).toHaveBeenCalledWith(
'Warning: [antd: Tabs] `onPrevClick` and `onNextClick` has been removed. Please use `onTabScroll` instead.',
);
@@ -87,21 +88,21 @@ describe('Tabs', () => {
});
it('tabBarGutter should work', () => {
- const wrapper = mount(
+ const { container: wrapper } = render(
,
);
- expect(wrapper.render()).toMatchSnapshot();
- const wrapper2 = mount(
+ expect(wrapper.firstChild).toMatchSnapshot();
+ const { container: wrapper2 } = render(
,
);
- expect(wrapper2.render()).toMatchSnapshot();
+ expect(wrapper2.firstChild).toMatchSnapshot();
});
});
diff --git a/docs/react/faq.en-US.md b/docs/react/faq.en-US.md
index 8189184535..2507104dbc 100644
--- a/docs/react/faq.en-US.md
+++ b/docs/react/faq.en-US.md
@@ -7,11 +7,11 @@ Here are the frequently asked questions about Ant Design and antd that you shoul
---
-### Will you provide Sass/Stylus(etc.) style files in addition to the Less style files currently included?
+## Will you provide Sass/Stylus(etc.) style files in addition to the Less style files currently included?
There is currently no plan to add support for Sass/Stylus(etc.) style files, but using tools on Google you can easily convert the provided Less files to your desired style format.
-### `Select Dropdown DatePicker TimePicker Popover Popconfirm` disappears when I click another popup component inside it. How do I resolve this?
+## `Select Dropdown DatePicker TimePicker Popover Popconfirm` disappears when I click another popup component inside it. How do I resolve this?
This is an old bug that has been fixed since `v3.11.x`. If you're using an older version, you can use `