ant-design-testing
Easier testing for ant-design-based UI library
$ pnpm install ant-design-testing -D
then, modify the prefixCls if you need it
// setupTests.ts
import { provider } from 'ant-design-testing';
provider({ prefixCls: 'ant' });
// yourInput.test.tsx
import { input } from 'ant-design-testing';
describe("Test input's fire functions", () => {
test('fireChange', () => {
const fn = jest.fn();
const { container } = render(<Input onChange={fn} />);
input.fireChange(container, 'test');
expect(fn).toBeCalled();
});
});