mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-06 05:58:46 +08:00
bef9539e22
* feat: add ref * feat: table support reference * chore: rename * chore: proxy * test: add test case * chore: fix lint * docs: update desc * docs: update desc * docs: update desc * chore: clean up * chore: fix lint
23 lines
585 B
TypeScript
23 lines
585 B
TypeScript
import React from 'react';
|
|
|
|
import type { TableRef } from '..';
|
|
import Table from '..';
|
|
import { render } from '../../../tests/utils';
|
|
|
|
describe('Table.IE', () => {
|
|
beforeAll(() => {
|
|
window.Proxy = undefined as any;
|
|
global.Proxy = undefined as any;
|
|
});
|
|
|
|
it('support reference', () => {
|
|
const tblRef = React.createRef<TableRef>();
|
|
const { container } = render(<Table ref={tblRef} />);
|
|
|
|
const wrapDom = container.querySelector('.ant-table-wrapper')!;
|
|
|
|
expect(tblRef.current).toBe(wrapDom);
|
|
expect(tblRef.current?.nativeElement).toBe(wrapDom);
|
|
});
|
|
});
|