ant-design/tests/shared/mountTest.tsx
叶枫 502dac12aa
docs: format code (#48309)
* docs: fix code

* feat: lint

* feat: prettier

* feat: test

* feat: review

* feat: format html

* feat: format html
2024-04-08 14:04:08 +08:00

18 lines
520 B
TypeScript

import React from 'react';
import { render } from '../utils';
// eslint-disable-next-line jest/no-export
export default function mountTest(Component: React.ComponentType) {
describe(`mount and unmount`, () => {
// https://github.com/ant-design/ant-design/pull/18441
it(`component could be updated and unmounted without errors`, () => {
const { unmount, rerender } = render(<Component />);
expect(() => {
rerender(<Component />);
unmount();
}).not.toThrow();
});
});
}