mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 02:59:58 +08:00
502dac12aa
* docs: fix code * feat: lint * feat: prettier * feat: test * feat: review * feat: format html * feat: format html
18 lines
520 B
TypeScript
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();
|
|
});
|
|
});
|
|
}
|