Skip to content

mortalYoung/ant-design-testing

Repository files navigation

ant-design-testing

Easier testing for ant-design-based UI library

Usage

$ 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();
    });
});

About

Easier testing for ant-design-based UI library

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages